X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=cd08ab68c82dbc358c8edd5cf34362f638a4a2b1;hb=95b1cd01669f9867511f9a65ce01e4404e5800b3;hp=04ef7cd4b37ca63665c77d8d856e88346d1ca567;hpb=3505a866fe0b494af4ff5d65a0295330fbde5bc3;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 04ef7cd4..cd08ab68 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -106,12 +106,10 @@ void focus_set_client(Client *client) static gboolean focus_under_pointer() { - Window w; - int i, x, y; - guint u; + int x, y; GList *it; - if (XQueryPointer(ob_display, ob_root, &w, &w, &x, &y, &i, &i, &u)) { + if (ob_pointer_pos(&x, &y)) { for (it = stacking_list; it != NULL; it = it->next) { Client *c = it->data; if (c->desktop == screen_desktop && @@ -161,9 +159,7 @@ void focus_fallback(FallbackType type) for (it = focus_order[screen_desktop]; it != NULL; it = it->next) if (type != Fallback_Unfocusing || it->data != old) - if (client_normal(it->data) && - ((Client*)it->data)->frame->visible && - client_focus(it->data)) + if (client_normal(it->data) && client_focus(it->data)) return; /* nothing to focus */ @@ -209,7 +205,7 @@ Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, } ft = client_focus_target(it->data); if (ft == it->data && focus_client != ft && client_normal(ft) && - ft->frame->visible && client_focus(ft)) { + client_focus(ft)) { noreorder++; /* avoid reordering the focus_order */ return ft; }