[vino/3] radio button tweak



commit e5fe336bae2545a1b5c7086ebfb2fbc9e3b9d27d
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Jul 5 14:57:25 2010 -0400

    radio button tweak

 capplet/vino-radio-button.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/capplet/vino-radio-button.c b/capplet/vino-radio-button.c
index 8127a1d..a5a866f 100644
--- a/capplet/vino-radio-button.c
+++ b/capplet/vino-radio-button.c
@@ -124,13 +124,22 @@ static void
 vino_radio_button_toggled (GtkToggleButton *button)
 {
   VinoRadioButton *vrb = (VinoRadioButton *) button;
-  const GSList *list;
 
-  list = gtk_radio_button_get_group (&vrb->parent_instance);
-  while (list)
+  /* As it is, we get the notification of the old button becoming inactivity
+   * followed by the notification of the new button becoming active.  Only run
+   * when the new button becomes active in order to avoid unnecessary
+   * notifications.
+   */
+  if (gtk_toggle_button_get_active (button))
     {
-      g_object_notify (list->data, "settings-active");
-      list = list->next;
+      const GSList *list;
+
+      list = gtk_radio_button_get_group (&vrb->parent_instance);
+      while (list)
+        {
+          g_object_notify (list->data, "settings-active");
+          list = list->next;
+        }
     }
 }
 



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