}
void
+event_drain(uint8_t rt)
+{
+ xcb_generic_event_t *evt;
+
+ xcb_flush(conn);
+ while ((evt = xcb_poll_for_event(conn))) {
+ if (XCB_EVENT_RESPONSE_TYPE(evt) != rt)
+ event_handle(evt);
+
+ free(evt);
+ }
+}
+
+void
switchws(struct swm_region *r, union arg *args)
{
int wsid = args->id, unmap_old = 0;
TAILQ_FOREACH(win, &old_ws->winlist, entry)
unmap_window(win);
- xcb_flush(conn);
+ if (focus_mode == SWM_FOCUS_DEFAULT)
+ event_drain(XCB_ENTER_NOTIFY);
+ else
+ xcb_flush(conn);
}
void
stack();
- a.id = SWM_ARG_ID_FOCUSCUR;
+ if (focus_mode == SWM_FOCUS_DEFAULT)
+ event_drain(XCB_ENTER_NOTIFY);
+ a.id = SWM_ARG_ID_FOCUSCUR;
focus(r, &a);
}
}
xcb_flush(conn);
+ event_drain(XCB_ENTER_NOTIFY);
}
void