GNOME Bugzilla – Bug 172998
allow button activation without keyboard grab
Last modified: 2011-02-04 16:18:46 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.
Created attachment 39819 [details] [review] patch for gtk-2-6
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.
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
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)