]> Dogcows Code - chaz/openbox/blobdiff - openbox/geom.h
Pick the monitor most relevant to a rectangle more cleverly.
[chaz/openbox] / openbox / geom.h
index 7c5ee32e31047643cbe0544072f0f419d3874967..8ac0e550830980d4ea05f612389155278cb891ce 100644 (file)
@@ -24,6 +24,7 @@
 
 typedef struct _GravityCoord {
     gint pos;
+    gint denom;
     gboolean center;
     gboolean opposite;
 } GravityCoord;
@@ -64,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) \
@@ -160,6 +163,6 @@ typedef struct _StrutPartial {
      (s1).bottom_end == (s2).bottom_end)
 
 #define RANGES_INTERSECT(r1x, r1w, r2x, r2w) \
-    (r1x < r2x + r2w && r1x + r1w > r2x)
+    (r1w && r2w && r1x < r2x + r2w && r1x + r1w > r2x)
 
 #endif
This page took 0.028166 seconds and 4 git commands to generate.