From a90f0c977540fb01ca62bfb6a4361f0182abb9cd Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 21 Apr 2014 10:41:07 +0200 Subject: [PATCH] Call AllowEvents after grabbed events on a drawin When we get an event due to a previous GrabButtons call, we have to continue normal event processing again, because the server froze the input device for us. Without this, everything appears to freeze. Signed-off-by: Uli Schlachter --- event.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/event.c b/event.c index a6a3b8a2..50511e0b 100644 --- a/event.c +++ b/event.c @@ -196,6 +196,16 @@ event_handle_button(xcb_button_press_event_t *ev) lua_pop(globalconf.L, 1); /* check if any button object matches */ event_button_callback(ev, &drawin->buttons, -1, 1, NULL); + /* Either we are receiving this due to ButtonPress/Release on the root + * window or because we grabbed the button on the window. In the later + * case we have to call AllowEvents. + * Use AsyncPointer instead of ReplayPointer so that the event is + * "eaten" instead of being handled again on the root window. + */ + if(ev->child == XCB_NONE) + xcb_allow_events(globalconf.connection, + XCB_ALLOW_ASYNC_POINTER, + XCB_CURRENT_TIME); } else if((c = client_getbyframewin(ev->event))) {