Move keybindings filters to be common across plugins
@hadess
Submitted by Bastien Nocera Link to original bug (#610262)
Description
From https://bugzilla.redhat.com/show_bug.cgi?id=205910:
" It probably has the same problem gtk had a while ago, it selects for some xkb events, without making sure to unselect all the others. "
We'd need to use XkbSelectEvents, but there's only one "filter" per process, so we'd need to split out (or merge) the different bits of g-s-d that require key press filtering (and there's quite a few):
$ grep gdk_window_add_filter *.c
gnome-settings-accessibility-keyboard.c: gdk_window_add_filter (NULL,
cb_xkb_event_filter, NULL);
gnome-settings-clipboard.c: gdk_window_add_filter (gdkwin,
clipboard_manager_event_filter, NULL);
gnome-settings-daemon.c: gdk_window_add_filter (
gnome-settings-keybindings.c: gdk_window_add_filter
(gdk_screen_get_root_window (screen),
gnome-settings-keyboard.c: gdk_window_add_filter (NULL,
gnome-settings-keyboard-xkb.c: gdk_window_add_filter (NULL, (GdkFilterFunc)
gnome-settings-mouse.c: gdk_window_add_filter
(gdk_screen_get_root_window (screen),
gnome-settings-multimedia-keys.c: gdk_window_add_filter
(gdk_screen_get_root_window (l->data),
Sergey said: IMHO "merging" would look more logical. We just need some ... internal "micro API" for dealing with these multiple filters. Unfortunately XkbSelectEvents/XkbSelectEventDetails do not have "get current mask" functions so g-s-d would have to keep track of these masks itself...