GNOME Bugzilla – Bug 151555
XkbGetState() and XkbStateNotify
Last modified: 2005-09-20 05:45:15 UTC
Currently, gtk+ selects for XKBStateNotify in *all* circumstances. This event is emitted every time a modifier or a mouse button is pressed. GTK+'s response to this event is to call XkbGetState() to see what changed. - This is not needed. The necessary information is already available in the XkbStateNotify event - The call XkbSelectEventDetail() can be used to specify when exactly the X server should emit the XkbStateNotify event. Calling XkbSelectEventDetail() with the right mask would allow GTK+ to only get the event when something interesting actually happens.
Soeren, do you have a patch for this ?
Created attachment 51922 [details] [review] a patch Does this patch look right, Soeren ?
2005-09-20 Matthias Clasen <mclasen@redhat.com> Avoid unnecessary XkbGetState() calls and XkbStateNotify events. (#151555, Søren Sandmann) * gdk/x11/gdkdisplay-x11.c (gdk_display_open): Use XkbSelectEventDetails() to select XkbStateNotify events for only the state we care about. * gdk/x11/gdkprivate-x11.h: * gdk/x11/gdkkeys-x11.c (_gdk_keymap_state_changed): Pass the event into the function and update the keymap state from the state information contained in the event. Adjust all callers.