]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
indenting
[chaz/openbox] / openbox / focus.c
index 523c7b5d057cf262181a65f38bffe2f20c71475a..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;
 }
 
This page took 0.022381 seconds and 4 git commands to generate.