After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172998 - allow button activation without keyboard grab
allow button activation without keyboard grab
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 302344
 
 
Reported: 2005-04-07 21:08 UTC by William Jon McCann
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for gtk-2-6 (1.08 KB, patch)
2005-04-07 21:09 UTC, William Jon McCann
none Details | Review
patch to add testcase (2.74 KB, patch)
2005-06-17 21:30 UTC, William Jon McCann
none Details | Review

Description William Jon McCann 2005-04-07 21:08:23 UTC
GtkButton will only activate a button when it can acquire a gdk_keyboard_grab. 
It seems this is only needed for the button animation.  The attached patch
simply skips the animation when the keyboard cannot be grabbed.
Comment 1 William Jon McCann 2005-04-07 21:09:35 UTC
Created attachment 39819 [details] [review]
patch for gtk-2-6
Comment 2 Matthias Clasen 2005-06-17 20:29:57 UTC
So the theory here is that we don't need to grab at all, provided we 
stop the animation on focus out. Needs to be tested, of course.
Comment 3 William Jon McCann 2005-06-17 21:30:54 UTC
Created attachment 47932 [details] [review]
patch to add testcase

This patch adds the ability to test plug/socket with gdk keyboard grabs.

With the patch applied, run testsocket.

* Select "Grab keyboard"
* Click "Add Active Child"
* Try to activate the "Close" button using the Control-C mnemonic
* Doesn't work

* Deselect "Grab keyboard"
* Try to activate the "Close" button using the Control-C mnemonic
* It works
Comment 4 Matthias Clasen 2005-06-27 20:05:15 UTC
Committed to HEAD only, since it may depend on some cleanups
I recently did in the gdk grab tracking code.

2005-06-27  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkbutton.c (gtk_real_button_activate): Continue
	to activate even if we can't grab the keyboard.
	(gtk_button_finish_activate): Only ungrab when we have
	a keyboard grab.  (#172998, William Jon McCann)