+static void focus_fallback(gboolean warp)
+{
+ GList *it;
+
+ for (it = focus_order[screen_desktop]; it != NULL; it = it->next)
+ if (client_focus(it->data)) {
+ if (warp) { /* XXX make this configurable */
+ XEvent e;
+ Client *c = it->data;
+
+ /* skip the next enter event from the desktop switch so focus
+ doesn't skip briefly to what was under the pointer */
+ if (XCheckTypedEvent(ob_display, EnterNotify, &e)) {
+ XPutBackEvent(ob_display, &e);
+ /* XXX WERE NOT SKIPPING THEM ALL@&*)! */
+ g_message("Skip");
+ ++skip_enter;
+ }
+
+ /* I have to do this warp twice! Otherwise windows dont get
+ Enter/Leave events when i warp on a desktop switch! */
+ XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
+ c->area.width / 2, c->area.height / 2);
+ XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
+ c->area.width / 2, c->area.height / 2);
+ }
+ break;
+ }
+}
+
+static void focus_under_pointer()