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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2014-04-21 10:41:07 +02:00
parent 160eba9384
commit 4073f8d886
1 changed files with 10 additions and 0 deletions

10
event.c
View File

@ -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)))
{