diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2014-01-22 21:48:28 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2014-01-22 21:48:28 +0000 |
commit | 8c52ec99e30d45945213ff42dce3d4b13085c104 (patch) | |
tree | bde9f0da2b81d78233f6642799f4460f2c183cc3 /app/cwm/xevents.c | |
parent | 62f2ad5ec935e935cb7f4fa7a24cd67ad3ece24b (diff) |
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 'app/cwm/xevents.c')
-rw-r--r-- | app/cwm/xevents.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 6f6a2d641..58a2a9c7a 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.105 2014/01/20 23:03:51 okan Exp $ + * $OpenBSD: xevents.c,v 1.106 2014/01/22 21:48:27 okan Exp $ */ /* @@ -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); } |