]> git.sur5r.net Git - i3/i3/commitdiff
Grab XCB_GRAB_SYNC and replay the event so it doesn’t get lost
authorMichael Stapelberg <michael+git@stapelberg.de>
Wed, 25 Feb 2009 18:11:49 +0000 (19:11 +0100)
committerMichael Stapelberg <michael+git@stapelberg.de>
Wed, 25 Feb 2009 18:11:49 +0000 (19:11 +0100)
src/handlers.c
src/mainx.c

index a147e2f41192cdcd24a617d7f4e9ec35d455a25f..d058b650eec5f39c2224742ad4982d7eae221d3e 100644 (file)
@@ -147,6 +147,8 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
 
         if (con == NULL) {
                 printf("dock. done.\n");
+                xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
+                xcb_flush(conn);
                 return 1;
         }
 
@@ -154,6 +156,8 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
 
         if (!border_click) {
                 printf("client. done.\n");
+                xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
+                xcb_flush(conn);
                 return 1;
         }
 
index c3a7bbcd589c232686d120a9ad743996f8094084..ef431220a2e4e175c08f1ff2b4d4204f4056507c 100644 (file)
@@ -200,7 +200,7 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
 
         /* We need to grab the mouse buttons for click to focus */
         xcb_grab_button(conn, false, child, XCB_EVENT_MASK_BUTTON_PRESS,
-                        XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, root, XCB_NONE,
+                        XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, root, XCB_NONE,
                         1 /* left mouse button */,
                         XCB_BUTTON_MASK_ANY /* don’t filter for any modifiers */);