+ if (XQueryPointer(ob_display, ob_root, &w, &w, &x, &y, &i, &i, &u))
+ {
+ for (it = stacking_list; it != NULL; it = it->next) {
+ Client *c = it->data;
+ if (c->desktop == screen_desktop &&
+ RECT_CONTAINS(c->frame->area, x, y))
+ break;
+ }
+ if (it != NULL) {
+ return client_normal(it->data) && client_focus(it->data);
+ }
+ }
+ return FALSE;
+}
+
+static void chew_enter_events()
+{
+ XEvent e;
+
+ /* XXX... not anymore
+ skip the next enter event from the desktop switch so focus
+ doesn't skip briefly to what was under the pointer */
+
+ /* kill all enter events from prior to the desktop switch, we
+ aren't interested in them if we have found our own target
+ to focus.
+ XXX this is rude to other plugins...can this be done
+ better? count the events in the queue? */
+ while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+/*
+ {
+ XPutBackEvent(ob_display, &e);
+ g_message("skip");
+ ++skip_enter;
+ }
+*/
+}
+
+static void focus_fallback(gboolean switching_desks)
+{
+ GList *it;
+
+ for (it = focus_order[screen_desktop]; it != NULL; it = it->next)
+ if (client_normal(it->data) && client_focus(it->data)) {
+ if (switching_desks) {