X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=22036917a85a2719fc9de5701db976b8c7599af5;hb=2612dbf0504c9e35171248b44a2b58b63a80b624;hp=523c7b5d057cf262181a65f38bffe2f20c71475a;hpb=5f5160b40c89c28a7e86dc66c08d1788bb6b0f1d;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 523c7b5d..22036917 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -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; }