]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
provide a means to properly ignore enter events for focus changes
[chaz/openbox] / openbox / focus.c
index 523c7b5d057cf262181a65f38bffe2f20c71475a..541cf0101453b461e45726aa42424c7c0cef7d83 100644 (file)
@@ -119,23 +119,10 @@ void focus_set_client(ObClient *client)
 
 static gboolean focus_under_pointer()
 {
-    int x, y;
-    GList *it;
+    ObClient *c;
 
-    if (screen_pointer_pos(&x, &y)) {
-        for (it = stacking_list; it != NULL; it = it->next) {
-            if (WINDOW_IS_CLIENT(it->data)) {
-                ObClient *c = WINDOW_AS_CLIENT(it->data);
-                if (c->desktop == screen_desktop &&
-                    RECT_CONTAINS(c->frame->area, x, y))
-                    break;
-            }
-        }
-        if (it != NULL) {
-            g_assert(WINDOW_IS_CLIENT(it->data));
-            return client_normal(it->data) && client_focus(it->data);
-        }
-    }
+    if ((c = client_under_pointer()))
+        return client_normal(c) && client_focus(c);
     return FALSE;
 }
 
@@ -180,8 +167,9 @@ void focus_fallback(ObFocusFallbackType type)
     */
     focus_set_client(NULL);
 
-    if (config_focus_follow && focus_under_pointer())
-        return;
+    if (!config_focus_last && config_focus_follow)
+        if (focus_under_pointer())
+            return;
 
     if (type == OB_FOCUS_FALLBACK_UNFOCUSING && old) {
         /* try for transient relations */
This page took 0.023618 seconds and 4 git commands to generate.