Use poll and XNextEvent to replace XNextEvent blocking inside the x11 event

handler.
This commit is contained in:
okan
2017-12-27 17:04:35 +00:00
parent 03e5d86952
commit 3d7c82936e
2 changed files with 18 additions and 6 deletions

View File

@@ -436,9 +436,11 @@ xev_process(void)
{
XEvent e;
XNextEvent(X_Dpy, &e);
if (e.type - Conf.xrandr_event_base == RRScreenChangeNotify)
xev_handle_randr(&e);
else if (e.type < LASTEvent && xev_handlers[e.type] != NULL)
(*xev_handlers[e.type])(&e);
while (XPending(X_Dpy)) {
XNextEvent(X_Dpy, &e);
if (e.type - Conf.xrandr_event_base == RRScreenChangeNotify)
xev_handle_randr(&e);
else if (e.type < LASTEvent && xev_handlers[e.type] != NULL)
(*xev_handlers[e.type])(&e);
}
}