X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=f37c02e97704c12766dd6e31ba2c25643fa373df;hb=d34741f58c0732e7c720bbe7aa4cd063f9db92d1;hp=ca3e12731e971960f511ac6195f6ef8d8e93718f;hpb=aaabb13c0a1c41b6b20ea75df707671569fb08ab;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index ca3e1273..f37c02e9 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -2,7 +2,7 @@ screen.c for the Openbox window manager Copyright (c) 2006 Mikael Magnusson - Copyright (c) 2003 Ben Jansens + Copyright (c) 2003-2007 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ /*! The event mask to grab on the root window */ #define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \ EnterWindowMask | LeaveWindowMask | \ - SubstructureNotifyMask | SubstructureRedirectMask | \ + SubstructureRedirectMask | \ ButtonPressMask | ButtonReleaseMask | ButtonMotionMask) guint screen_num_desktops; @@ -894,7 +894,7 @@ void screen_show_desktop(gboolean show) /* focus desktop */ for (it = focus_order[screen_desktop]; it; it = g_list_next(it)) if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP && - client_focus(it->data)) + client_validate(it->data) && client_focus(it->data)) break; } else { focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); @@ -1172,6 +1172,30 @@ Rect *screen_area_monitor(guint desktop, guint head) return &area[desktop][head]; } +guint screen_find_monitor(Rect *search) +{ + guint i; + guint most = 0; + guint mostv = 0; + + for (i = 0; i < screen_num_monitors; ++i) { + Rect *area = screen_physical_area_monitor(i); + if (RECT_INTERSECTS_RECT(*area, *search)) { + Rect r; + guint v; + + RECT_SET_INTERSECTION(r, *area, *search); + v = r.width * r.height; + + if (v > mostv) { + mostv = v; + most = i; + } + } + } + return most; +} + Rect *screen_physical_area() { return screen_physical_area_monitor(screen_num_monitors);