]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: fix state of keypresses in sighandler (like in i3-input)
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Mar 2010 15:10:47 +0000 (16:10 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Mar 2010 15:10:47 +0000 (16:10 +0100)
src/sighandler.c

index 590608b63636fd3a139743664e47673c2314f12b..92cbc5cb3abb7e7bfdc5abba914d83ccb4276cbb 100644 (file)
@@ -83,7 +83,14 @@ static int sig_draw_window(xcb_connection_t *conn, xcb_window_t win, int width,
  *
  */
 static int sig_handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_press_event_t *event) {
-        xcb_keysym_t sym = xcb_key_press_lookup_keysym(keysyms, event, event->state);
+        uint16_t state = event->state;
+
+        /* Apparantly, after activating numlock once, the numlock modifier
+         * stays turned on (use xev(1) to verify). So, to resolve useful
+         * keysyms, we remove the numlock flag from the event state */
+        state &= ~xcb_numlock_mask;
+
+        xcb_keysym_t sym = xcb_key_press_lookup_keysym(keysyms, event, state);
 
         if (sym == 'e') {
                 DLOG("User issued exit-command, raising error again.\n");