[gnome-control-center] sharing: only set the "set-from-dbus" flag if the switch state changes



commit 1d7bd99750be3cce150ff95ecab07f62ce7b8884
Author: Thomas Wood <thomas wood intel com>
Date:   Wed Jan 23 12:03:32 2013 +0000

    sharing: only set the "set-from-dbus" flag if the switch state changes

 panels/sharing/cc-remote-login.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/panels/sharing/cc-remote-login.c b/panels/sharing/cc-remote-login.c
index d9f7aca..fcd0a20 100644
--- a/panels/sharing/cc-remote-login.c
+++ b/panels/sharing/cc-remote-login.c
@@ -52,8 +52,12 @@ active_state_ready_callback (GObject      *source_object,
   g_variant_unref (tmp_variant);
 
   /* set the switch to the correct state */
-  g_object_set_data (G_OBJECT (gtkswitch), "set-from-dbus", GINT_TO_POINTER (1));
-  gtk_switch_set_active (gtkswitch, active);
+  if (gtk_switch_get_active (gtkswitch) != active)
+    {
+      g_object_set_data (G_OBJECT (gtkswitch), "set-from-dbus",
+                         GINT_TO_POINTER (1));
+      gtk_switch_set_active (gtkswitch, active);
+    }
   gtk_widget_set_sensitive (gtkswitch, TRUE);
 }
 



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