]> Pileus Git - ~andy/gtk/commitdiff
button: don't be active when holding the mouse button outside the bounds
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 17 Jan 2012 22:14:23 +0000 (17:14 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 1 Mar 2012 20:57:55 +0000 (15:57 -0500)
GtkButton currently draws itself as active (pressed down) in case we're
pressing and holding the mouse pointer outside its bounds; this is
misleading though, since we won't activate the button unless the mouse
is released inside the button itself.
Fix this by only setting the ACTIVE state flag when the button is
actually pressed down.

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

gtk/gtkbutton.c

index 5db97236fb0d895c985de5d48aa2f5a3f8a3905e..f28a79ceb4366f95802eeeb8764b37d61d73b05b 100644 (file)
@@ -2427,7 +2427,7 @@ gtk_button_update_state (GtkButton *button)
   if (priv->in_button)
     new_state |= GTK_STATE_FLAG_PRELIGHT;
 
-  if (priv->button_down || depressed)
+  if (depressed)
     new_state |= GTK_STATE_FLAG_ACTIVE;
 
   _gtk_button_set_depressed (button, depressed);