summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2017-06-20 18:28:47 -0400
committerMartin Wimpress <[email protected]>2017-06-20 23:28:47 +0100
commitcf0b97690c9d8606be4e07b58a4cf7070b53570d (patch)
tree5341734e82847d0a40a35763f7b4b3ffb3ddf459
parent9cfd9eb0e63ae34c1224d9be051a02d0389f5d01 (diff)
downloadmate-settings-daemon-cf0b97690c9d8606be4e07b58a4cf7070b53570d.tar.bz2
mate-settings-daemon-cf0b97690c9d8606be4e07b58a4cf7070b53570d.tar.xz
Request keyboard event reports from global keybindings of other windows (#179)
* Request keyboard event reports from global keybindings of other windows This allows mate-settings-daemon to honor global keybindings whenever a different application has keybindings that seem conflicting, but are usually not. For example, an application defining a `Super_L` keybinding and MATE having defining a shortcut that uses the `<Mod4>` key. They are the same physical keyboard, but one is a modifier and the other is not. Without requesting keyboard reports from other windows, the `<Mod4>` shortcuts are swallowed whenever there is a `Super_L` shortcut elsewhere. * Remove KeyReleaseMask as the keybindings_filter only looks at KeyPress * Guard against BadWindow errors
-rw-r--r--plugins/keybindings/msd-keybindings-manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/keybindings/msd-keybindings-manager.c b/plugins/keybindings/msd-keybindings-manager.c
index 89ae0bc..f2a1c00 100644
--- a/plugins/keybindings/msd-keybindings-manager.c
+++ b/plugins/keybindings/msd-keybindings-manager.c
@@ -538,6 +538,7 @@ msd_keybindings_manager_start (MsdKeybindingsManager *manager,
{
GdkDisplay *dpy;
GdkScreen *screen;
+ GdkWindow *window;
int screen_num;
int i;
@@ -549,9 +550,13 @@ msd_keybindings_manager_start (MsdKeybindingsManager *manager,
for (i = 0; i < screen_num; i++) {
screen = gdk_display_get_screen (dpy, i);
- gdk_window_add_filter (gdk_screen_get_root_window (screen),
+ window = gdk_screen_get_root_window(screen);
+ gdk_window_add_filter (window,
(GdkFilterFunc) keybindings_filter,
manager);
+ gdk_error_trap_push ();
+ XSelectInput(GDK_DISPLAY_XDISPLAY(dpy), GDK_WINDOW_XID(window), KeyPressMask);
+ gdk_error_trap_pop_ignored ();
}
manager->priv->screens = get_screens_list ();