changing workspaces */
static SLIST_HEAD(ignore_head, Ignore_Event) ignore_events;
+/*
+ * Adds the given sequence to the list of events which are ignored.
+ * If this ignore should only affect a specific response_type, pass
+ * response_type, otherwise, pass -1.
+ *
+ * Every ignored sequence number gets garbage collected after 5 seconds.
+ *
+ */
void add_ignore_event(const int sequence, const int response_type) {
struct Ignore_Event *event = smalloc(sizeof(struct Ignore_Event));
* Checks if the given sequence is ignored and returns true if so.
*
*/
-static bool event_is_ignored(const int sequence, const int response_type) {
+bool event_is_ignored(const int sequence, const int response_type) {
struct Ignore_Event *event;
time_t now = time(NULL);
for (event = SLIST_FIRST(&ignore_events); event != SLIST_END(&ignore_events);) {
if (event->sequence != sequence)
continue;
- if (event->response_type != 0 &&
+ if (event->response_type != -1 &&
event->response_type != response_type)
continue;
cookie = xcb_get_window_attributes_unchecked(conn, event->window);
DLOG("window = 0x%08x, serial is %d.\n", event->window, event->sequence);
- add_ignore_event(event->sequence, 0);
+ add_ignore_event(event->sequence, -1);
manage_window(event->window, cookie, false);
x_push_changes(croot);
*
*/
static int handle_expose_event(xcb_expose_event_t *event) {
- Con *parent, *con;
+ Con *parent;
/* event->count is the number of minimum remaining expose events for this
* window, so we skip all events but the last one */
return 1;
}
- if (parent->window)
- x_draw_decoration(parent);
-
- TAILQ_FOREACH(con, &(parent->nodes_head), nodes) {
- DLOG("expose for con %p / %s\n", con, con->name);
- if (con->window)
- x_draw_decoration(con);
- }
-
- /* We also need to render the decorations of other Cons nearby the Con
- * itself to not get overlapping decorations */
- TAILQ_FOREACH(con, &(parent->parent->nodes_head), nodes) {
- DLOG("expose for con %p / %s\n", con, con->name);
- if (con->window)
- x_draw_decoration(con);
- }
+ /* re-render the parent (recursively, if it’s a split con) */
+ x_deco_recurse(parent);
xcb_flush(conn);
return 1;