summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2018-02-13 15:06:22 +0000
committerokan <okan>2018-02-13 15:06:22 +0000
commit13763662c9ba3c0fed9732b14fb81a63235a1f26 (patch)
tree40b8a5b8ef25e722b8625410f96676cd3f19b79e
parente6bf7429b3443b2ed6491774995658aaad0a5b3a (diff)
downloadcwm-13763662c9ba3c0fed9732b14fb81a63235a1f26.tar.gz
cwm-13763662c9ba3c0fed9732b14fb81a63235a1f26.tar.xz
cwm-13763662c9ba3c0fed9732b14fb81a63235a1f26.zip
Consolidate region 'view' and 'area'.
-rw-r--r--calmwm.h1
-rw-r--r--screen.c12
2 files changed, 4 insertions, 9 deletions
diff --git a/calmwm.h b/calmwm.h
index 451e634..a99ba02 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -204,7 +204,6 @@ TAILQ_HEAD(autogroup_q, autogroup);
 struct region_ctx {
 	TAILQ_ENTRY(region_ctx)	 entry;
 	int			 num;
-	struct geom		 area;
 	struct geom		 view; /* viewable area */
 	struct geom		 work; /* workable area, gap-applied */
 };
diff --git a/screen.c b/screen.c
index 0cb4ae0..8d05f25 100644
--- a/screen.c
+++ b/screen.c
@@ -146,12 +146,12 @@ struct geom
 screen_area(struct screen_ctx *sc, int x, int y, enum apply_gap apply_gap)
 {
 	struct region_ctx	*rc;
-	struct geom		 area = sc->work;
+	struct geom		 area = sc->view;
 
 	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;
+		if ((x >= rc->view.x) && (x < (rc->view.x + rc->view.w)) &&
+		    (y >= rc->view.y) && (y < (rc->view.y + rc->view.h))) {
+			area = rc->view;
 			break;
 		}
 	}
@@ -193,10 +193,6 @@ 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;