]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: keypress: Only use the lower 8 bits of the mask so that mouse buttons are...
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 19 May 2009 11:51:03 +0000 (13:51 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 May 2009 11:51:03 +0000 (13:51 +0200)
Sometimes, when the mouse button gets stuck, state contains the bit for
BUTTON_MASK_1 (or other buttons). We filter them out to continue processing
keys correctly.

src/handlers.c

index c1a55893c2051907dadc69e0d19ae4c1d086863a..f801532c1f3249779b5c5c7f11d07df02ffd44c2 100644 (file)
@@ -109,6 +109,10 @@ int handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_press_event_
         /* Remove the numlock bit, all other bits are modifiers we can bind to */
         uint16_t state_filtered = event->state & ~(xcb_numlock_mask | XCB_MOD_MASK_LOCK);
 
+        /* Only use the lower 8 bits of the state (modifier masks) so that mouse
+         * button masks are filtered out */
+        state_filtered &= 0xFF;
+
         /* Find the binding */
         Binding *bind;
         TAILQ_FOREACH(bind, &bindings, bindings)