X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=cd08ab68c82dbc358c8edd5cf34362f638a4a2b1;hb=25ffe6b566379f25dd3cf7e74aeefd084b7e1b19;hp=c189bc9e5c262dfa435a60ebea83395e990353ab;hpb=5cf61ee02354c1c9f80c11f3796afc4b948055d6;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index c189bc9e..cd08ab68 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -9,6 +9,7 @@ #include "dispatch.h" #include "focus.h" #include "parse.h" +#include "stacking.h" #include #include @@ -35,7 +36,8 @@ void focus_startup() -100, -100, 1, 1, 0, CopyFromParent, InputOutput, CopyFromParent, CWOverrideRedirect, &attrib); - XMapRaised(ob_display, focus_backup); + XMapWindow(ob_display, focus_backup); + stacking_raise_internal(focus_backup); /* start with nothing focused */ focus_set_client(NULL); @@ -104,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 &&