X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fclient.c;h=209e5397c8f103523ad51bf9798acf2fadeb33e7;hb=a43303bdcbb5460f8d50823c4d0cedc30de6bb57;hp=3d51a78e622e74212e8e724eeda74851d776cfe6;hpb=38370b2e82c20acc1a42a03e1e26bdc018a0b9e5;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 3d51a78e..209e5397 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -183,9 +183,6 @@ void client_manage_all() } } XFree(children); - - if (config_focus_new) - focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); } void client_manage(Window window) @@ -3017,3 +3014,24 @@ int client_directional_edge_search(ObClient *c, ObDirection dir) } return dest; } + +ObClient* client_under_pointer() +{ + int x, y; + GList *it; + ObClient *ret = NULL; + + 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)) { + ret = c; + break; + } + } + } + } + return ret; +}