summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-11 14:22:01 +0000
committerokan <okan>2015-11-11 14:22:01 +0000
commit00bdd48b1d93b91946c7655ec8829060040aec22 (patch)
tree97a1ef802671b187c9566744ef04cacd9d3e65e1 /screen.c
parent09565bc42362bb3a9fd24c75441e89c723114364 (diff)
downloadcwm-00bdd48b1d93b91946c7655ec8829060040aec22.tar.gz
cwm-00bdd48b1d93b91946c7655ec8829060040aec22.tar.xz
cwm-00bdd48b1d93b91946c7655ec8829060040aec22.zip
Partial revert of replacing screen_area() with region_find(); until a
fix for a regression is found; this bug has been around for a long time
it seems, but this change exposed it. Likely need to track clients in to
and out of regions.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/screen.c b/screen.c
index 4fc6f4e..a1b8b30 100644
--- a/screen.c
+++ b/screen.c
@@ -138,6 +138,24 @@ region_find(struct screen_ctx *sc, int x, int y)
 	return(rc);
 }
 
+struct geom
+screen_area(struct screen_ctx *sc, int x, int y, int flags)
+{
+	struct region_ctx	*rc;
+	struct geom		 area = sc->work;
+
+	TAILQ_FOREACH(rc, &sc->regionq, entry) {
+		if ((x >= rc->area.x) && (x < (rc->area.x + rc->area.w)) &&
+		    (y >= rc->area.y) && (y < (rc->area.y + rc->area.h))) {
+			area = rc->area;
+			break;
+		}
+	}
+	if (flags & CWM_GAP)
+		area = screen_apply_gap(sc, area);
+	return(area);
+}
+
 void
 screen_update_geometry(struct screen_ctx *sc)
 {
@@ -171,6 +189,10 @@ screen_update_geometry(struct screen_ctx *sc)
 
 			rc = xmalloc(sizeof(*rc));
 			rc->num = i;
+			rc->area.x = ci->x;
+			rc->area.y = ci->y;
+			rc->area.w = ci->width;
+			rc->area.h = ci->height;
 			rc->view.x = ci->x;
 			rc->view.y = ci->y;
 			rc->view.w = ci->width;