summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-10-11 08:24:49 +0000
committerDana Jansens <danakj@orodu.net>2003-10-11 08:24:49 +0000
commitcf397b0e60efb0b90ccd3add468bbf128e47e323 (patch)
tree0daf18a6e9b521414ced94b854e3e872249800de /openbox
parentf5f59cea71b42ac462a8d30122646b79462e6499 (diff)
smarter picking of heads for client windows
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 095eded3..fab5328d 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -2906,15 +2906,25 @@ void client_set_undecorated(ObClient *self, gboolean undecorated)
guint client_monitor(ObClient *self)
{
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, self->frame->area))
- break;
+ if (RECT_INTERSECTS_RECT(*area, self->frame->area)) {
+ Rect r;
+ guint v;
+
+ RECT_SET_INTERSECTION(r, *area, self->frame->area);
+ v = r.width * r.height;
+
+ if (v > mostv) {
+ mostv = v;
+ most = i;
+ }
+ }
}
- if (i == screen_num_monitors) i = 0;
- g_assert(i < screen_num_monitors);
- return i;
+ return most;
}
ObClient *client_search_top_transient(ObClient *self)