} color_t;
/* Global data */
+static int running;
static void *cache;
static Atom atoms[natoms];
static int (*xerrorxlib)(Display *, XErrorEvent *);
//printf("event: %d\n", type);
/* Common data for all these events ... */
- ptr_t ptr; mod_t mod;
+ ptr_t ptr = {}; mod_t mod = {};
if (type == KeyPress || type == KeyRelease ||
type == ButtonPress || type == ButtonRelease ||
type == MotionNotify) {
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;
+}