[Xfce4-commits] [panel-plugins/xfce4-places-plugin] 25/30: Fix reloading of icon themes

noreply at xfce.org noreply at xfce.org
Mon Apr 22 12:08:16 CEST 2019


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

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-places-plugin.

commit a5daf605a727d57c73dde1a8375ddf12f2ac329a
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Apr 21 11:13:05 2019 -0400

    Fix reloading of icon themes
---
 panel-plugin/button.c | 11 ++++-------
 panel-plugin/button.h |  1 -
 panel-plugin/view.c   | 12 +++++-------
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/panel-plugin/button.c b/panel-plugin/button.c
index 692ecee..3f526e4 100644
--- a/panel-plugin/button.c
+++ b/panel-plugin/button.c
@@ -237,6 +237,7 @@ static void
 places_button_construct(PlacesButton *self, XfcePanelPlugin *plugin)
 {
     GtkOrientation orientation;
+    GtkIconTheme *icon_theme;
 
     g_assert(XFCE_IS_PANEL_PLUGIN(plugin));
 
@@ -268,8 +269,9 @@ places_button_construct(PlacesButton *self, XfcePanelPlugin *plugin)
     g_signal_connect(G_OBJECT(plugin), "size-changed",
                      G_CALLBACK(places_button_size_changed), self);
 
-    self->style_set_id = g_signal_connect(G_OBJECT(self), "style-set",
-                     G_CALLBACK(places_button_theme_changed), NULL);
+    icon_theme = gtk_icon_theme_get_default ();
+    g_signal_connect_swapped(icon_theme, "changed",
+                             G_CALLBACK(places_button_theme_changed), self);
     self->screen_changed_id = g_signal_connect(G_OBJECT(self), "screen-changed",
                      G_CALLBACK(places_button_theme_changed), NULL);
 
@@ -294,11 +296,6 @@ places_button_dispose(GObject *object)
 {
     PlacesButton *self = PLACES_BUTTON(object);
 
-    if (self->style_set_id != 0) {
-        g_signal_handler_disconnect(self, self->style_set_id);
-        self->style_set_id = 0;
-    }
-
     if (self->screen_changed_id != 0) {
         g_signal_handler_disconnect(self, self->screen_changed_id);
         self->screen_changed_id = 0;
diff --git a/panel-plugin/button.h b/panel-plugin/button.h
index 93f88bf..18c5744 100644
--- a/panel-plugin/button.h
+++ b/panel-plugin/button.h
@@ -52,7 +52,6 @@ struct _PlacesButton
     gchar *label_text;
     places_button_image_pixbuf_factory *pixbuf_factory;
     gint plugin_size;
-    gulong style_set_id;
     gulong screen_changed_id;
 };
 
diff --git a/panel-plugin/view.c b/panel-plugin/view.c
index add0264..bbac588 100644
--- a/panel-plugin/view.c
+++ b/panel-plugin/view.c
@@ -871,7 +871,8 @@ pview_remote_event(XfcePanelPlugin *panel_plugin,
 PlacesView*
 places_view_init(XfcePanelPlugin *plugin)
 {
-    PlacesView *view;                   /* internal use in this file */
+    PlacesView   *view;                   /* internal use in this file */
+    GtkIconTheme *icon_theme;
 
     DBG("initializing");
     g_assert(plugin != NULL);
@@ -901,14 +902,11 @@ places_view_init(XfcePanelPlugin *plugin)
 
     pview_button_update(view);
 
+
     /* signals for icon theme/screen changes */
-    /* FIXME: disable style-updated signal because it is fired whenever the
-       pointer moves over the button, so the menu is destroyed "faster" than
-       it is created. The downside is that now icons are not updated when
-       theme changes.
-    g_signal_connect_swapped(view->button, "style-updated",
+    icon_theme = gtk_icon_theme_get_default ();
+    g_signal_connect_swapped (icon_theme, "changed",
                               G_CALLBACK(pview_destroy_menu), view);
-    */
     g_signal_connect_swapped(view->button, "screen-changed",
                              G_CALLBACK(pview_destroy_menu), view);
 

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


More information about the Xfce4-commits mailing list