X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=209e5397c8f103523ad51bf9798acf2fadeb33e7;hb=a43303bdcbb5460f8d50823c4d0cedc30de6bb57;hp=ab37bb65349b2dd61a8e3e8314add5211b84a92a;hpb=abde4bc153b0b79b770506e2e35e36fcb1e32dc3;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index ab37bb65..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) @@ -1960,7 +1957,7 @@ void client_configure_full(ObClient *self, ObCorner anchor, (resized && config_redraw_resize)))); /* if the client is enlarging, the resize the client before the frame */ - if (!user || (send_resize_client && (w > oldw || h > oldh))) + if (send_resize_client && user && (w > oldw || h > oldh)) XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh)); /* move/resize the frame to match the request */ @@ -1995,7 +1992,7 @@ void client_configure_full(ObClient *self, ObCorner anchor, } /* if the client is shrinking, then resize the frame before the client */ - if (user && (send_resize_client && (w <= oldw || h <= oldh))) + if (send_resize_client && (!user || (w <= oldw || h <= oldh))) XResizeWindow(ob_display, self->window, w, h); XFlush(ob_display); @@ -2594,11 +2591,12 @@ gboolean client_focus(ObClient *self) void client_unfocus(ObClient *self) { - g_assert(focus_client == self); + if (focus_client == self) { #ifdef DEBUG_FOCUS - ob_debug("client_unfocus for %lx\n", self->window); + ob_debug("client_unfocus for %lx\n", self->window); #endif - focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING); + focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING); + } } void client_activate(ObClient *self, gboolean here) @@ -3016,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; +}