diff options
author | lukefromdc <[email protected]> | 2023-06-12 00:10:07 -0400 |
---|---|---|
committer | Luke from DC <[email protected]> | 2023-06-14 02:58:02 +0000 |
commit | 30f9c781e2d85140159d4f9f3232287f89b9acc5 (patch) | |
tree | be70d1f33b2d28d0f648e4188e3fc89b9ee49adf /mate-volume-control | |
parent | 9cb20f31afc556805c604a7be0d34f0531060c89 (diff) | |
download | mate-media-30f9c781e2d85140159d4f9f3232287f89b9acc5.tar.bz2 mate-media-30f9c781e2d85140159d4f9f3232287f89b9acc5.tar.xz |
Applet: port to in-process for wayland support
*Wayland cannot use xembed/GtkPlug/GtkSocket so port to in-process.
*The applet then works on wayland.
*Two out of process-only code blocks requiring separate windows removed
Diffstat (limited to 'mate-volume-control')
-rw-r--r-- | mate-volume-control/Makefile.am | 42 | ||||
-rw-r--r-- | mate-volume-control/applet-main.c | 2 | ||||
-rw-r--r-- | mate-volume-control/gvc-applet.c | 17 | ||||
-rw-r--r-- | mate-volume-control/org.mate.applets.GvcApplet.mate-panel-applet.desktop.in.in | 3 | ||||
-rw-r--r-- | mate-volume-control/org.mate.panel.applet.GvcAppletFactory.service.in | 4 |
5 files changed, 23 insertions, 45 deletions
diff --git a/mate-volume-control/Makefile.am b/mate-volume-control/Makefile.am index 06eae15..a29e95b 100644 --- a/mate-volume-control/Makefile.am +++ b/mate-volume-control/Makefile.am @@ -9,10 +9,6 @@ bin_PROGRAMS = \ $(NULL) endif -if ENABLE_PANELAPPLET -libexec_PROGRAMS = mate-volume-control-applet -endif - AM_CPPFLAGS = \ $(WARN_CFLAGS) \ $(VOLUME_CONTROL_CFLAGS) \ @@ -25,29 +21,21 @@ AM_CPPFLAGS = \ $(NULL) if ENABLE_PANELAPPLET -APPLET_LOCATION = $(libexecdir)/mate-volume-control-applet - +APPLET_LOCATION = $(libdir)/libmate-volume-control-applet.so appletsdir = $(datadir)/mate-panel/applets applets_in_files = org.mate.applets.GvcApplet.mate-panel-applet.desktop.in applets_DATA = $(applets_in_files:.mate-panel-applet.desktop.in=.mate-panel-applet) +mate_volume_control_applet_libdir= $(libdir) +mate_volume_control_applet_lib_LTLIBRARIES=libmate-volume-control-applet.la $(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.GvcAppletFactory.service.in -service_DATA = $(service_in_files:.service.in=.service) - -org.mate.panel.applet.GvcAppletFactory.service: $(service_in_files) - $(AM_V_GEN)sed \ - -e "s|\@LOCATION\@|$(APPLET_LOCATION)|" \ - $< > $@ - EXTRA_DIST = \ $(applets_in_files).in \ $(service_in_files) @@ -79,14 +67,14 @@ mate_volume_control_status_icon_CFLAGS = $(WARN_CFLAGS) endif if ENABLE_PANELAPPLET -mate_volume_control_applet_LDADD = \ - -lm \ - libmatevolumecontrol.la \ - $(VOLUME_CONTROL_LIBS) \ - $(MATEDESKTOP_LIBS) \ + +D_LDFLAGS = \ + -module -avoid-version \ + $(WARN_LDFLAGS) \ + $(AM_LDFLAGS) \ $(NULL) -mate_volume_control_applet_SOURCES = \ +libmate_volume_control_applet_la_SOURCES = \ gvc-stream-applet-icon.h \ gvc-stream-applet-icon.c \ gvc-applet.h \ @@ -94,7 +82,15 @@ mate_volume_control_applet_SOURCES = \ applet-main.c \ $(NULL) -mate_volume_control_applet_CFLAGS = $(WARN_CFLAGS) +libmate_volume_control_applet_la_CFLAGS = $(WARN_CFLAGS) + +libmate_volume_control_applet_la_LIBADD = \ + -lm \ + libmatevolumecontrol.la \ + $(MATE_APPLETS4_CFLAGS) \ + $(VOLUME_CONTROL_LIBS) \ + $(NULL) + endif mate_volume_control_LDADD = \ diff --git a/mate-volume-control/applet-main.c b/mate-volume-control/applet-main.c index 32a42bc..961275f 100644 --- a/mate-volume-control/applet-main.c +++ b/mate-volume-control/applet-main.c @@ -88,7 +88,7 @@ applet_factory (MatePanelApplet* applet, const char* iid, gpointer data) } /* needed by mate-panel applet library */ -MATE_PANEL_APPLET_OUT_PROCESS_FACTORY("GvcAppletFactory", +MATE_PANEL_APPLET_IN_PROCESS_FACTORY("GvcAppletFactory", PANEL_TYPE_APPLET, "Volume Control applet", applet_factory, diff --git a/mate-volume-control/gvc-applet.c b/mate-volume-control/gvc-applet.c index 3a08978..35d7e6e 100644 --- a/mate-volume-control/gvc-applet.c +++ b/mate-volume-control/gvc-applet.c @@ -508,12 +508,6 @@ menu_activate_open_volume_control (GtkAction *action, GvcApplet *applet) gboolean gvc_applet_fill (GvcApplet *applet, MatePanelApplet* applet_widget) { - GdkEventMask event_mask; - GdkWindow *window; - - g_set_application_name (_("Volume Control Applet")); - gtk_window_set_default_icon_name (APPLET_ICON); - mate_panel_applet_set_flags (applet_widget, MATE_PANEL_APPLET_EXPAND_MINOR); applet->priv->applet = applet_widget; @@ -545,16 +539,7 @@ gvc_applet_fill (GvcApplet *applet, MatePanelApplet* applet_widget) gtk_container_add (GTK_CONTAINER (applet->priv->applet), GTK_WIDGET (applet->priv->box)); gtk_widget_show_all (GTK_WIDGET (applet->priv->applet)); - /* Enable 'scroll-event' signal to get through */ - window = gtk_widget_get_window (GTK_WIDGET (applet->priv->icon_input)); - event_mask = gdk_window_get_events (window); - gdk_window_set_events (window, event_mask | GDK_SCROLL_MASK); - - window = gtk_widget_get_window (GTK_WIDGET (applet->priv->icon_output)); - event_mask = gdk_window_get_events (window); - gdk_window_set_events (window, event_mask | GDK_SCROLL_MASK); - - /* Update icons on size/orientation changes */ + /* Update icons on size/orientation changes*/ g_object_connect (applet->priv->applet, "signal::change_size", gvc_applet_set_size, applet, "signal::change_orient", gvc_applet_set_orient, applet, diff --git a/mate-volume-control/org.mate.applets.GvcApplet.mate-panel-applet.desktop.in.in b/mate-volume-control/org.mate.applets.GvcApplet.mate-panel-applet.desktop.in.in index 46a8374..3748f03 100644 --- a/mate-volume-control/org.mate.applets.GvcApplet.mate-panel-applet.desktop.in.in +++ b/mate-volume-control/org.mate.applets.GvcApplet.mate-panel-applet.desktop.in.in @@ -1,6 +1,7 @@ [Applet Factory] Id=GvcAppletFactory -Location=@LOCATION@ +InProcess=true +Location=@APPLET_LOCATION@ Name=Volume Control Factory Description=Volume Control Factory diff --git a/mate-volume-control/org.mate.panel.applet.GvcAppletFactory.service.in b/mate-volume-control/org.mate.panel.applet.GvcAppletFactory.service.in deleted file mode 100644 index 0a01e2d..0000000 --- a/mate-volume-control/org.mate.panel.applet.GvcAppletFactory.service.in +++ /dev/null @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=org.mate.panel.applet.GvcAppletFactory -Exec=@LOCATION@ - |