diff options
author | okan <okan> | 2014-01-22 21:48:27 +0000 |
---|---|---|
committer | okan <okan> | 2014-01-22 21:48:27 +0000 |
commit | 77aa5ac45b06b4afa392e21d55e3318913b0347b (patch) | |
tree | 958f412e4eb2d3682b95e9c62eb40085e43d3e41 /xevents.c | |
parent | ac3162439ad826026b499363b445e8c533313ff2 (diff) | |
download | cwm-77aa5ac45b06b4afa392e21d55e3318913b0347b.tar.gz cwm-77aa5ac45b06b4afa392e21d55e3318913b0347b.tar.xz cwm-77aa5ac45b06b4afa392e21d55e3318913b0347b.zip |
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.
Diffstat (limited to 'xevents.c')
-rw-r--r-- | xevents.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/xevents.c b/xevents.c index c5c1c7e..b01f966 100644 --- a/xevents.c +++ b/xevents.c @@ -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); } |