[network-manager-applet/nma-1-2] applet: fix handling of changed icon theme signal



commit be2f9525a637dd132416c4bc6da68e758cca168e
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Mon Jun 13 09:07:50 2016 +0200

    applet: fix handling of changed icon theme signal
    
    Handler's arguments were swapped. Since we also need to update the
    current icon when the theme changes, introduce a dedicated handler.
    
    Fixes: 40f052d38af9e9f3bc42c6cbbb51e9044ab73663
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767574
    (cherry picked from commit f0f11106eb988229ec6a813457ec504f64c2f22d)

 src/applet.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index fc87815..636898c 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -2943,7 +2943,7 @@ nma_icon_check_and_load (const char *name, NMApplet *applet)
 #include "fallback-icon.h"
 
 static void
-nma_icons_reload (NMApplet *applet, gpointer user_data)
+nma_icons_reload (NMApplet *applet)
 {
        GError *error = NULL;
        gs_unref_object GdkPixbufLoader *loader = NULL;
@@ -2978,13 +2978,19 @@ error:
        g_clear_error (&error);
 }
 
+static void nma_icon_theme_changed (GtkIconTheme *icon_theme, NMApplet *applet)
+{
+       nma_icons_reload (applet);
+       applet_schedule_update_icon (applet);
+}
+
 static void nma_icons_init (NMApplet *applet)
 {
        gboolean path_appended;
 
        if (applet->icon_theme) {
                g_signal_handlers_disconnect_by_func (applet->icon_theme,
-                                                     G_CALLBACK (nma_icons_reload),
+                                                     G_CALLBACK (nma_icon_theme_changed),
                                                      applet);
                g_object_unref (G_OBJECT (applet->icon_theme));
        }
@@ -3004,9 +3010,9 @@ static void nma_icons_init (NMApplet *applet)
                                   GINT_TO_POINTER (TRUE));
        }
 
-       g_signal_connect (applet->icon_theme, "changed", G_CALLBACK (nma_icons_reload), applet);
+       g_signal_connect (applet->icon_theme, "changed", G_CALLBACK (nma_icon_theme_changed), applet);
 
-       nma_icons_reload (applet, NULL);
+       nma_icons_reload (applet);
 }
 
 static void
@@ -3034,7 +3040,7 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
                g_warn_if_fail (size == 0);
        }
 
-       nma_icons_reload (applet, NULL);
+       nma_icons_reload (applet);
 
        applet_schedule_update_icon (applet);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]