[gtk+] button: don't be active when holding the mouse button outside the bounds



commit 5495152e30f60fed3949ba1cfe7b6b06dc13fe53
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 17 17:14:23 2012 -0500

    button: don't be active when holding the mouse button outside the bounds
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 5db9723..f28a79c 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -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);



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