diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-11 17:34:07 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-11 17:34:07 +0000 |
| commit | 7229bea3c60de23a5fa4ad46bcae6171044ade81 (patch) | |
| tree | 71d5aade8f35a15510fd596079e706466941c567 /openbox/screen.c | |
| parent | fe317164865f5a08e18bb0b4fa9519fa4ca48a45 (diff) | |
client_configure_full is trying to move a window, it shouldn't determine the window's monitor from its current position, but from the new position instead. move client_monitor()'s logic into screen, more generically, and let client_configure_full use that
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index d97a732b..3542dfdc 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -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); |
