]> Pileus Git - ~andy/gtk/commitdiff
GtkSwitch: Return FALSE from the button press handler
authorMatthias Clasen <mclasen@redhat.com>
Wed, 24 Aug 2011 03:29:19 +0000 (23:29 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 24 Aug 2011 03:29:19 +0000 (23:29 -0400)
This makes the behavior identical to other widgets which
handle button presses, and it avoids problems when placing
switches into a windows main toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=656986

gtk/gtkswitch.c

index 8604079cf064d6a09e92e61911d741df27c0e915..acb306db532a349a03030d9c289de8844e57b7cf 100644 (file)
@@ -112,7 +112,7 @@ gtk_switch_button_press (GtkWidget      *widget,
       if (event->x <= allocation.width / 2)
         {
           priv->in_press = TRUE;
-          return FALSE;
+          return TRUE;
         }
 
       priv->offset = event->x - allocation.width / 2;
@@ -125,7 +125,7 @@ gtk_switch_button_press (GtkWidget      *widget,
       if (event->x >= allocation.width / 2)
         {
           priv->in_press = TRUE;
-          return FALSE;
+          return TRUE;
         }
 
       priv->offset = event->x;
@@ -137,7 +137,7 @@ gtk_switch_button_press (GtkWidget      *widget,
                 "gtk-dnd-drag-threshold", &priv->drag_threshold,
                 NULL);
 
-  return FALSE;
+  return TRUE;
 }
 
 static gboolean