summaryrefslogtreecommitdiff
path: root/openbox/geom.h
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2011-10-15 23:04:21 -0400
committerDana Jansens <danakj@orodu.net>2012-10-06 21:56:56 -0400
commitd68116c9c9b2c9a9925d872141eff8e301ef3bb3 (patch)
tree4ba60e897c890d59a8a4e136734534893c6aa0df /openbox/geom.h
parentdc69fe7cedd679bf38c1be25130ed502af8ad4c4 (diff)
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.
Diffstat (limited to 'openbox/geom.h')
-rw-r--r--openbox/geom.h2
1 files changed, 2 insertions, 0 deletions
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) \