From d68116c9c9b2c9a9925d872141eff8e301ef3bb3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 15 Oct 2011 23:04:21 -0400 Subject: Pick the monitor most relevant to a rectangle more cleverly. When monitors overlap (this happens with cloning), we were choosing a monitor to associate with a window, for maximization for example, somewhat arbitrarily. Now we have a more clever algorithm that considers the configured primary monitor first, and that does not prefer monitors based on their sizes, but only how much of the window is in the monitor, excluding parts that were claimed by another monitor already. --- openbox/geom.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openbox/geom.h') diff --git a/openbox/geom.h b/openbox/geom.h index 003b0081..8ac0e550 100644 --- a/openbox/geom.h +++ b/openbox/geom.h @@ -65,6 +65,8 @@ typedef struct _Rect { #define RECT_RIGHT(r) ((r).x + (r).width - 1) #define RECT_BOTTOM(r) ((r).y + (r).height - 1) +#define RECT_AREA(r) ((r).width * (r).height) + #define RECT_SET_POINT(r, nx, ny) \ (r).x = (nx), (r).y = (ny) #define RECT_SET_SIZE(r, w, h) \ -- cgit v1.2.3