summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authorokan <okan>2013-01-08 04:12:51 +0000
committerokan <okan>2013-01-08 04:12:51 +0000
commitbf9d9815976c0afae2e87afeebaa57b02b1d911c (patch)
tree04bbefefe007df702c689a7ccf38b770f3dbae07 /screen.c
parente7b85cfb2f4d04e283d448cc3a09014e858eeb94 (diff)
downloadcwm-bf9d9815976c0afae2e87afeebaa57b02b1d911c.tar.gz
cwm-bf9d9815976c0afae2e87afeebaa57b02b1d911c.tar.xz
cwm-bf9d9815976c0afae2e87afeebaa57b02b1d911c.zip
teach screen_find_xinerama() about gap and adjust (simplify) callers;
menu becomes gap-aware for free.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/screen.c b/screen.c
index 01c2f73..6b7de6b 100644
--- a/screen.c
+++ b/screen.c
@@ -132,7 +132,7 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y)
 	struct geom		 geom;
 	int			 i;
 
-	geom = sc->view;
+	geom = sc->work;
 
 	if (sc->xinerama == NULL)
 		return (geom);
@@ -141,10 +141,10 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y)
 		info = &sc->xinerama[i];
 		if (x >= info->x_org && x < info->x_org + info->width &&
 		    y >= info->y_org && y < info->y_org + info->height) {
-			geom.x = info->x_org;
-			geom.y = info->y_org;
-			geom.w = info->width;
-			geom.h = info->height;
+			geom.x = info->x_org + sc->gap.left;
+			geom.y = info->y_org + sc->gap.top;
+			geom.w = info->width - (sc->gap.left + sc->gap.right);
+			geom.h = info->height - (sc->gap.top + sc->gap.bottom);
 			break;
 		}
 	}