Bug 174910 - mouseover button, activate another with keyboard, then can't click orig button
Summary: mouseover button, activate another with keyboard, then can't click orig button
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gtk2
Version: 4
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact:
URL: Test pygtk program: http://struct.org...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-03 21:31 UTC by travis abbott
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-12-07 17:31:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
here's that patch again (342 bytes, patch)
2005-12-03 21:54 UTC, travis abbott
no flags Details | Diff

Description travis abbott 2005-12-03 21:31:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
Please describe the problem:
The effect of this bug is:
 you mouseover a button and keep the mouse there
 you activate another button with the keyboard
 you then try to click the button you have been hovering over
 it's in_button flag is cleared so it does not get the "clicked" signal.
 moving the mouse out and back in is a workaround.


This happens to me every day in anaconda. I am clicking through pages (next, next, next) and I get a popup window that I acknowledge with the spacebar. Then I have to move the mouse out and back in to be able to click Next again.

The problem is also present in gnome, when you try to click on the panel
menus the first time, you have to mouse in, out, in to get it to work.

This problem emerged in gtk 2.5.4 and is present in 2.8.8.

Version-Release number of selected component (if applicable):
gtk2-2.6.10 (problem came in gtk 2.5.4 and persists in 2.8.8)

How reproducible:
Always

Steps to Reproduce:
1. Run any gtk program that uses buttons.
2. Mouseover a button and stay inside it.
3. Activate another button with the keyboard.
4. Try and click the original button and see that it does not activate.

If you have pygtk installed you can use this program for a visual representation of what signals are firing:

http://struct.org/gtk/gtkbug.py
1. Download and run: python gtkbug.py
2. Click button 2 and see that the clicked signal fires
3. Keep the mouse in button 2 and press ALT+1 to fire button 1
4. Now click button 2 and see that only pressed and release signals fire, not clicked as it should.

Actual Results:  The buttons don't activate.

Expected Results:  The buttons should activate.

Additional info:

This has also been filed over on the gtk bugzilla so will hopefully be fixed in a future release, but it'd be nice to get this patch in FC4 in the mean time.
(built against gtk+-2.6.7 but will apply even to 2.8.8 http://struct.org/gtk/gtk+-2.6.7-grab.patch).

diff -rupN a/gtk/gtkbutton.c b/gtk/gtkbutton.c
--- a/gtk/gtkbutton.c	2005-04-06 23:45:30.000000000 -0500
+++ b/gtk/gtkbutton.c	2005-12-03 14:36:38.000000000 -0600
@@ -1735,7 +1735,6 @@ gtk_button_grab_notify (GtkWidget *widge
 
   if (!was_grabbed)
     {
-      button->in_button = FALSE;
       gtk_real_button_released (button);
     }
 }



The fix is easy to apply to any version of gtk, just remove

  button->in_button = FALSE;

from gtk_button_grab_notify() before calling gtk_real_button_released() in
gtk/gtkbutton.c (near bottom of file). I don't think this function needs to be
setting whether or not the mouse is in the button. I tested that the proper
state of this field is maintained even when removing this line (when you
mouseout it does get set to FALSE properly).

Comment 1 travis abbott 2005-12-03 21:54:08 UTC
Created attachment 121807 [details]
here's that patch again

forgot i could attach the patch here ;)

Comment 2 Matthias Clasen 2005-12-07 17:31:20 UTC
Tracked upstream in http://bugzilla.gnome.org/show_bug.cgi?id=323146


Note You need to log in before you can comment on or make changes to this bug.