Somewhat streamline event loop/restart/quit handling; most notable

change allows a restart to trigger proper teardown first, even though
teardown is not (yet) complete.

After some discussion with oga@nicotinebsd.org regarding a more
complicated version/idea.
This commit is contained in:
okan
2014-01-22 21:48:27 +00:00
parent ac3162439a
commit 77aa5ac45b
5 changed files with 31 additions and 28 deletions

View File

@@ -400,18 +400,14 @@ xev_handle_expose(XEvent *ee)
client_draw_border(cc);
}
volatile sig_atomic_t xev_quit = 0;
void
xev_loop(void)
xev_process(void)
{
XEvent e;
while (xev_quit == 0) {
XNextEvent(X_Dpy, &e);
if (e.type - Randr_ev == RRScreenChangeNotify)
xev_handle_randr(&e);
else if (e.type < LASTEvent && xev_handlers[e.type] != NULL)
(*xev_handlers[e.type])(&e);
}
XNextEvent(X_Dpy, &e);
if (e.type - Randr_ev == RRScreenChangeNotify)
xev_handle_randr(&e);
else if (e.type < LASTEvent && xev_handlers[e.type] != NULL)
(*xev_handlers[e.type])(&e);
}