summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2017-06-26 14:11:19 -0400
committerVictor Kareh <[email protected]>2017-06-26 14:11:19 -0400
commit603e331e6cf480d2f9aed1e7d096333df39215aa (patch)
tree5259c4a0c808ad93ebd861db601780967cdc486a
parentcf0b97690c9d8606be4e07b58a4cf7070b53570d (diff)
downloadmate-settings-daemon-603e331e6cf480d2f9aed1e7d096333df39215aa.tar.bz2
mate-settings-daemon-603e331e6cf480d2f9aed1e7d096333df39215aa.tar.xz
Fix Xrandr applet dying on restart
When setting `KeyPressMask` as a reportable event for all windows, the keybinding for `Fn+F7` in Xrandr seems to fail. This change adds, rather than overrides, the `KeyPressMask` as a reportable event for the corresponding window. Fixes #180
-rw-r--r--plugins/keybindings/msd-keybindings-manager.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/keybindings/msd-keybindings-manager.c b/plugins/keybindings/msd-keybindings-manager.c
index f2a1c00..c022547 100644
--- a/plugins/keybindings/msd-keybindings-manager.c
+++ b/plugins/keybindings/msd-keybindings-manager.c
@@ -541,21 +541,30 @@ msd_keybindings_manager_start (MsdKeybindingsManager *manager,
GdkWindow *window;
int screen_num;
int i;
+ Display *xdpy;
+ Window xwindow;
+ XWindowAttributes atts;
g_debug ("Starting keybindings manager");
mate_settings_profile_start (NULL);
dpy = gdk_display_get_default ();
+ xdpy = GDK_DISPLAY_XDISPLAY (dpy);
screen_num = gdk_display_get_n_screens (dpy);
for (i = 0; i < screen_num; i++) {
screen = gdk_display_get_screen (dpy, i);
- window = gdk_screen_get_root_window(screen);
+ window = gdk_screen_get_root_window (screen);
+ xwindow = GDK_WINDOW_XID (window);
+
gdk_window_add_filter (window,
(GdkFilterFunc) keybindings_filter,
manager);
+
gdk_error_trap_push ();
- XSelectInput(GDK_DISPLAY_XDISPLAY(dpy), GDK_WINDOW_XID(window), KeyPressMask);
+ /* Add KeyPressMask to the currently reportable event masks */
+ XGetWindowAttributes (xdpy, xwindow, &atts);
+ XSelectInput (xdpy, xwindow, atts.your_event_mask | KeyPressMask);
gdk_error_trap_pop_ignored ();
}
manager->priv->screens = get_screens_list ();