Read all pending X11 events during input handling

This commit is contained in:
Iwan Timmer 2017-06-04 14:48:26 +02:00
parent f79a99bc05
commit 697bee2954

View File

@ -46,13 +46,11 @@ static Cursor cursor;
static bool grabbed = True;
static int x11_handler(int fd) {
if (!XPending(display))
return LOOP_OK;
XEvent event;
int button = 0;
int motion_x, motion_y;
while (XPending(display)) {
XNextEvent(display, &event);
switch (event.type) {
case KeyPress:
@ -127,6 +125,7 @@ static int x11_handler(int fd) {
break;
}
}
return LOOP_OK;
}