]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
indenting
[chaz/openbox] / openbox / focus.c
index 36ccbea30281fe820bab29e3b26282511249fcbd..22036917a85a2719fc9de5701db976b8c7599af5 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;
 }
 
@@ -398,11 +385,14 @@ void focus_directional_cycle(ObDirection dir,
             focus_cycle_target = ft;
             frame_adjust_focus(focus_cycle_target->frame, TRUE);
         }
-        popup_cycle(ft, dialog);
+    }
+    if (focus_cycle_target) {
+        popup_cycle(focus_cycle_target, dialog);
         if (dialog)
             return;
     }
 
+
 done_cycle:
     if (done && focus_cycle_target)
         client_activate(focus_cycle_target, FALSE);
This page took 0.02414 seconds and 4 git commands to generate.