X-Git-Url: http://pileus.org/git/?p=wmpus;a=blobdiff_plain;f=sys-x11.c;h=7222b462141d7f5eb5a38b22ca62ef6585bdeaff;hp=072216b76ca54c45550ae37be72c719e1d6a5aee;hb=43cb9b7de22dac5864d73321ec974bb937a217ff;hpb=776ac6910ee9db701c1cfe2ab234ae5fb96ce9db diff --git a/sys-x11.c b/sys-x11.c index 072216b..7222b46 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -55,6 +55,7 @@ typedef enum { } color_t; /* Global data */ +static int running; static void *cache; static Atom atoms[natoms]; static int (*xerrorxlib)(Display *, XErrorEvent *); @@ -569,10 +570,16 @@ void sys_run(win_t *root) wm_update(); // For struts /* Main loop */ - for(;;) + running = 1; + while (running) { XEvent ev; XNextEvent(root->sys->dpy, &ev); process_event(ev.type, &ev, root); } } + +void sys_exit(void) +{ + running = 0; +}