+focusout(XEvent *e)
+{
+ DNPRINTF(SWM_D_EVENT, "focusout: window: %lu\n", e->xfocus.window);
+
+ if (cur_focus && cur_focus->ws->r &&
+ cur_focus->id == e->xfocus.window) {
+ struct swm_screen *s = cur_focus->ws->r->s;
+ Window rr, cr;
+ int x, y, wx, wy;
+ unsigned int mask;
+
+ /* Try to detect synergy hiding the cursor. */
+ if (XQueryPointer(display, cur_focus->id,
+ &rr, &cr, &x, &y, &wx, &wy, &mask) != False &&
+ cr == 0 && !mask &&
+ x == DisplayWidth(display, s->idx)/2 &&
+ y == DisplayHeight(display, s->idx)/2) {
+ unfocus_win(cur_focus);
+ }
+ }
+}
+
+void