[PATCH 3/4] ephyr: Do grab/ungrab for ctrl+shift, not just shift+ctrl.

Eric Anholt eric at anholt.net
Mon Aug 26 13:33:36 PDT 2013


Given that the window title says "ctrl+shift", having pressing those
keys in that order not ungrab you is fairly mean.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 hw/kdrive/ephyr/ephyr.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index f32505f..805b7f4 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -1033,9 +1033,12 @@ ephyrProcessKeyRelease(xcb_generic_event_t *xev)
     if (!keysyms)
         keysyms = xcb_key_symbols_alloc(conn);
 
-    if ((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L
-         || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_R)
-        && (key->state & XCB_MOD_MASK_CONTROL)) {
+    if (((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L
+          || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_R)
+         && (key->state & XCB_MOD_MASK_CONTROL)) ||
+        ((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_L
+          || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_R)
+         && (key->state & XCB_MOD_MASK_SHIFT))) {
         KdScreenInfo *screen = screen_from_window(key->event);
         EphyrScrPriv *scrpriv = screen->driver;
 
-- 
1.8.4.rc3



More information about the xorg-devel mailing list