static xcb_connection_t *restore_conn;
static struct ev_io *xcb_watcher;
-static struct ev_check *xcb_check;
static struct ev_prepare *xcb_prepare;
static void restore_handle_event(int type, xcb_generic_event_t *event);
}
static void restore_xcb_prepare_cb(EV_P_ ev_prepare *w, int revents) {
- xcb_flush(restore_conn);
-}
-
-static void restore_xcb_check_cb(EV_P_ ev_check *w, int revents) {
xcb_generic_event_t *event;
if (xcb_connection_has_error(restore_conn)) {
free(event);
}
+
+ xcb_flush(restore_conn);
}
/*
/* This is not the initial connect, but a reconnect, most likely
* because our X11 connection was killed (e.g. by a user with xkill. */
ev_io_stop(main_loop, xcb_watcher);
- ev_check_stop(main_loop, xcb_check);
ev_prepare_stop(main_loop, xcb_prepare);
placeholder_state *state;
/* xcb_disconnect leaks memory in libxcb versions earlier than 1.11,
* but it’s the right function to call. See
- * http://cgit.freedesktop.org/xcb/libxcb/commit/src/xcb_conn.c?id=4dcbfd77b
+ * https://cgit.freedesktop.org/xcb/libxcb/commit/src/xcb_conn.c?id=4dcbfd77b
*/
xcb_disconnect(restore_conn);
free(xcb_watcher);
- free(xcb_check);
free(xcb_prepare);
}
}
xcb_watcher = scalloc(1, sizeof(struct ev_io));
- xcb_check = scalloc(1, sizeof(struct ev_check));
xcb_prepare = scalloc(1, sizeof(struct ev_prepare));
ev_io_init(xcb_watcher, restore_xcb_got_event, xcb_get_file_descriptor(restore_conn), EV_READ);
ev_io_start(main_loop, xcb_watcher);
- ev_check_init(xcb_check, restore_xcb_check_cb);
- ev_check_start(main_loop, xcb_check);
-
ev_prepare_init(xcb_prepare, restore_xcb_prepare_cb);
ev_prepare_start(main_loop, xcb_prepare);
}