summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2023-06-20 03:28:58 -0400
committerraveit65 <[email protected]>2023-07-17 02:47:28 +0200
commite6c5401a285e188b00c6d13e7b53d30ef6a6fe5f (patch)
tree182221b5bbd35767084996c2c2c47a092d8bd03a
parent6dd9ab19ab5a72c203dab7c2c96277f77e222260 (diff)
downloadmate-applets-e6c5401a285e188b00c6d13e7b53d30ef6a6fe5f.tar.bz2
mate-applets-e6c5401a285e188b00c6d13e7b53d30ef6a6fe5f.tar.xz
timerapplet: port to in-process for wayland
-rw-r--r--timerapplet/data/Makefile.am14
-rw-r--r--timerapplet/data/org.mate.applets.TimerApplet.mate-panel-applet.desktop.in.in4
-rw-r--r--timerapplet/data/org.mate.panel.applet.TimerAppletFactory.service.in3
-rw-r--r--timerapplet/src/Makefile.am16
-rw-r--r--timerapplet/src/timerapplet.c6
5 files changed, 17 insertions, 26 deletions
diff --git a/timerapplet/data/Makefile.am b/timerapplet/data/Makefile.am
index 2c034da3..2b8cebd4 100644
--- a/timerapplet/data/Makefile.am
+++ b/timerapplet/data/Makefile.am
@@ -1,6 +1,6 @@
NULL =
-APPLET_LOCATION = $(libexecdir)/timer-applet
+APPLET_LOCATION = $(libdir)/mate-applets/libmate-timer-applet.so
appletsdir = $(datadir)/mate-panel/applets
applets_in_files = org.mate.applets.TimerApplet.mate-panel-applet.desktop.in
@@ -8,19 +8,11 @@ applets_DATA = $(applets_in_files:.mate-panel-applet.desktop.in=.mate-panel-
$(applets_in_files): $(applets_in_files).in Makefile
$(AM_V_GEN)sed \
- -e "s|\@LOCATION\@|$(APPLET_LOCATION)|" \
+ -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \
$< > $@
$(applets_DATA): $(applets_in_files) Makefile
$(AM_V_GEN) $(MSGFMT) --desktop --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@
-servicedir = $(datadir)/dbus-1/services
-service_in_files = org.mate.panel.applet.TimerAppletFactory.service.in
-service_DATA = $(service_in_files:.service.in=.service)
-
-org.mate.panel.applet.TimerAppletFactory.service: $(service_in_files)
- $(AM_V_GEN)sed \
- -e "s|\@LOCATION\@|$(APPLET_LOCATION)|" \
- $< > $@
timer_gschema_in_files = org.mate.panel.applet.timer.gschema.xml.in
gsettings_SCHEMAS = $(timer_gschema_in_files:.xml.in=.xml)
@@ -28,7 +20,6 @@ gsettings_SCHEMAS = $(timer_gschema_in_files:.xml.in=.xml)
EXTRA_DIST = \
$(applets_in_files).in \
- $(service_in_files) \
$(timer_gschema_in_files) \
timerapplet-preferences.ui \
timerapplet-resources.gresource.xml \
@@ -37,7 +28,6 @@ EXTRA_DIST = \
CLEANFILES = \
$(applets_DATA) \
$(applets_in_files) \
- $(service_DATA) \
$(gsettings_SCHEMAS) \
*.gschema.valid \
$(NULL)
diff --git a/timerapplet/data/org.mate.applets.TimerApplet.mate-panel-applet.desktop.in.in b/timerapplet/data/org.mate.applets.TimerApplet.mate-panel-applet.desktop.in.in
index a111eb28..86b18021 100644
--- a/timerapplet/data/org.mate.applets.TimerApplet.mate-panel-applet.desktop.in.in
+++ b/timerapplet/data/org.mate.applets.TimerApplet.mate-panel-applet.desktop.in.in
@@ -1,11 +1,13 @@
[Applet Factory]
Id=TimerAppletFactory
-Location=@LOCATION@
+Location=@APPLET_LOCATION@
+InProcess=true
Name=Timer Factory
Description=Timer Factory
[TimerApplet]
Name=Timer
Description=Start a timer and receive a notification when it is finished
+Platforms=X11;Wayland
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=mate-panel-clock
diff --git a/timerapplet/data/org.mate.panel.applet.TimerAppletFactory.service.in b/timerapplet/data/org.mate.panel.applet.TimerAppletFactory.service.in
deleted file mode 100644
index b8cd68cc..00000000
--- a/timerapplet/data/org.mate.panel.applet.TimerAppletFactory.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.mate.panel.applet.TimerAppletFactory
-Exec=@LOCATION@
diff --git a/timerapplet/src/Makefile.am b/timerapplet/src/Makefile.am
index 6eb47ec9..5341cc16 100644
--- a/timerapplet/src/Makefile.am
+++ b/timerapplet/src/Makefile.am
@@ -1,5 +1,8 @@
NULL =
+mate_timer_applet_libdir= $(pkglibdir)
+mate_timer_applet_lib_LTLIBRARIES=libmate-timer-applet.la
+
AM_CPPFLAGS = \
$(MATE_APPLETS4_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
@@ -7,20 +10,18 @@ AM_CPPFLAGS = \
$(DISABLE_DEPRECATED_CFLAGS) \
$(NULL)
-libexec_PROGRAMS = timer-applet
-
-BUILT_SOURCES = timerapplet-resources.c timerapplet-resources.h
-nodist_timer_applet_SOURCES = $(BUILT_SOURCES)
-timer_applet_SOURCES = \
+libmate_timer_applet_la_SOURCES = \
timerapplet.c \
+ timerapplet-resources.c \
+ timerapplet-resources.h \
$(NULL)
-timer_applet_LDADD = \
+libmate_timer_applet_la_LIBADD = \
$(MATE_APPLETS4_LIBS) \
$(LIBNOTIFY_LIBS) \
$(NULL)
-timer_applet_CFLAGS = $(WARN_CFLAGS)
+libmate_timer_applet_la_CFLAGS = $(WARN_CFLAGS)
timerapplet-resources.c: $(srcdir)/../data/timerapplet-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data --generate-dependencies $(srcdir)/../data/timerapplet-resources.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name timerapplet $<
@@ -29,7 +30,6 @@ timerapplet-resources.h: $(srcdir)/../data/timerapplet-resources.gresource.xml $
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name timerapplet $<
CLEANFILES = \
- $(BUILT_SOURCES) \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/timerapplet/src/timerapplet.c b/timerapplet/src/timerapplet.c
index 8399ebb0..f2fcfc1e 100644
--- a/timerapplet/src/timerapplet.c
+++ b/timerapplet/src/timerapplet.c
@@ -125,6 +125,9 @@ timer_callback (TimerApplet *applet)
label = NULL;
tooltip = NULL;
+ if (!GTK_IS_WIDGET (applet->label))
+ return FALSE;
+
name = g_settings_get_string (applet->settings, NAME_KEY);
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (applet->applet));
@@ -373,7 +376,6 @@ timer_applet_fill (MatePanelApplet* applet_widget)
TimerApplet *applet;
AtkObject *atk_obj;
- g_set_application_name (_("Timer Applet"));
gtk_window_set_default_icon_name (APPLET_ICON);
if (!notify_is_initted ())
@@ -454,7 +456,7 @@ timer_factory (MatePanelApplet* applet, const char* iid, gpointer data)
}
/* needed by mate-panel applet library */
-MATE_PANEL_APPLET_OUT_PROCESS_FACTORY("TimerAppletFactory",
+MATE_PANEL_APPLET_IN_PROCESS_FACTORY("TimerAppletFactory",
PANEL_TYPE_APPLET,
"Timer applet",
timer_factory,