diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-01-31 17:32:37 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-01-31 17:32:37 -0500 |
| commit | 5563e251c36a1fbda703cf4bc3c8c6ae543829bd (patch) | |
| tree | a6838ef575c8800bc8e06d0491ac4f6f1bdd8a94 | |
| parent | e0c1978c516e3463ec3fdd66fba323fd514e2494 (diff) | |
| parent | 6a3ac556b9ed5fd6e578da20a144f22dd4769267 (diff) | |
Merge branch 'backport' into work
| -rw-r--r-- | openbox/client.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/openbox/client.c b/openbox/client.c index 9809b514..b1b5e8a3 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -910,6 +910,7 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, gint fw, fh; Rect desired; guint i; + gboolean found_mon; RECT_SET(desired, *x, *y, w, h); frame_rect_to_frame(self->frame, &desired); @@ -959,18 +960,26 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, rudeb = TRUE; } + /* we iterate through every monitor that the window is at least partially + on, to make sure it is obeying the rules on them all + + if the window does not appear on any monitors, then use the first one + */ + found_mon = FALSE; for (i = 0; i < screen_num_monitors; ++i) { Rect *a; if (!screen_physical_area_monitor_contains(i, &desired)) { - if (i < screen_num_monitors - 1) + if (i < screen_num_monitors - 1 || found_mon) continue; /* the window is not inside any monitor! so just use the first one */ a = screen_area(self->desktop, 0, NULL); - } else + } else { + found_mon = TRUE; a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &desired); + } /* This makes sure windows aren't entirely outside of the screen so you can't see them at all. |
