]> Dogcows Code - chaz/openbox/blobdiff - openbox/geom.h
Pick the monitor most relevant to a rectangle more cleverly.
[chaz/openbox] / openbox / geom.h
index bdcd3c55ba416a417e64187ff76cbddf2157be64..8ac0e550830980d4ea05f612389155278cb891ce 100644 (file)
@@ -23,7 +23,8 @@
 #include <glib.h>
 
 typedef struct _GravityCoord {
-    int pos;
+    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.023481 seconds and 4 git commands to generate.