From 1335e4a4c9c7af2f4ade5169d8385b1bd4c1b0e2 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 25 Feb 2009 19:11:49 +0100 Subject: [PATCH] =?utf8?q?Grab=20XCB=5FGRAB=5FSYNC=20and=20replay=20the=20?= =?utf8?q?event=20so=20it=20doesn=E2=80=99t=20get=20lost?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/handlers.c | 4 ++++ src/mainx.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/handlers.c b/src/handlers.c index a147e2f4..d058b650 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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; } diff --git a/src/mainx.c b/src/mainx.c index c3a7bbcd..ef431220 100644 --- a/src/mainx.c +++ b/src/mainx.c @@ -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 */); -- 2.39.5