[Xfce4-commits] [xfce/xfce4-panel] 03/03: appmenu: Listen to icon theme changes (Bug #15861)

noreply at xfce.org noreply at xfce.org
Sun Oct 13 01:21:33 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/xfce4-panel.

commit e6d8de6b2a43ebb456825cab7eb925eb508367fa
Author: Olivier Duchateau <duchateau.olivier at gmail.com>
Date:   Sun Oct 13 01:16:21 2019 +0200

    appmenu: Listen to icon theme changes (Bug #15861)
---
 plugins/applicationsmenu/applicationsmenu.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index b14c114..f099e1a 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -72,6 +72,7 @@ struct _ApplicationsMenuPlugin
 
   gulong           style_set_id;
   gulong           screen_changed_id;
+  gulong           theme_changed_id;
 };
 
 enum
@@ -209,9 +210,13 @@ applications_menu_plugin_class_init (ApplicationsMenuPluginClass *klass)
 static void
 applications_menu_plugin_init (ApplicationsMenuPlugin *plugin)
 {
+  GtkIconTheme *icon_theme;
+
   /* init garcon environment */
   garcon_set_environment_xdg (GARCON_ENVIRONMENT_XFCE);
 
+  icon_theme = gtk_icon_theme_get_default ();
+
   plugin->button = xfce_panel_create_toggle_button ();
   xfce_panel_plugin_add_action_widget (XFCE_PANEL_PLUGIN (plugin), plugin->button);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->button);
@@ -244,6 +249,8 @@ applications_menu_plugin_init (ApplicationsMenuPlugin *plugin)
                                                    G_CALLBACK (applications_menu_button_theme_changed), plugin);
   plugin->screen_changed_id = g_signal_connect_swapped (G_OBJECT (plugin->button), "screen-changed",
                                                         G_CALLBACK (applications_menu_button_theme_changed), plugin);
+  plugin->theme_changed_id = g_signal_connect_swapped (G_OBJECT (icon_theme), "changed",
+                                                       G_CALLBACK (applications_menu_plugin_set_garcon_menu), plugin);
 }
 
 
@@ -443,6 +450,7 @@ static void
 applications_menu_plugin_free_data (XfcePanelPlugin *panel_plugin)
 {
   ApplicationsMenuPlugin *plugin = XFCE_APPLICATIONS_MENU_PLUGIN (panel_plugin);
+  GtkIconTheme           *icon_theme;
 
   if (plugin->menu != NULL)
     gtk_widget_destroy (plugin->menu);
@@ -459,6 +467,14 @@ applications_menu_plugin_free_data (XfcePanelPlugin *panel_plugin)
       plugin->screen_changed_id = 0;
     }
 
+  if (plugin->theme_changed_id != 0)
+    {
+      icon_theme = gtk_icon_theme_get_default ();
+      g_signal_handler_disconnect (G_OBJECT (icon_theme),
+                                   plugin->theme_changed_id);
+      plugin->theme_changed_id = 0;
+    }
+
   g_free (plugin->button_title);
   g_free (plugin->button_icon);
   g_free (plugin->custom_menu_file);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list