summary refs log tree commit diff
path: root/menu.c
diff options
context:
space:
mode:
authorokan <okan>2015-06-26 17:17:46 +0000
committerokan <okan>2015-06-26 17:17:46 +0000
commit66bc4162170b72f192c156b692b621643f1e5d52 (patch)
treee0a727b6004df74903e50dae2a4fd4ed7b5acbed /menu.c
parent90288e2fc36a3b8be8f16b4f110b8af7e7a2ca12 (diff)
downloadcwm-66bc4162170b72f192c156b692b621643f1e5d52.tar.gz
cwm-66bc4162170b72f192c156b692b621643f1e5d52.tar.xz
cwm-66bc4162170b72f192c156b692b621643f1e5d52.zip
Mechanical change from xinerama to region backed areas.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/menu.c b/menu.c
index a348b40..5a7bef3 100644
--- a/menu.c
+++ b/menu.c
@@ -331,7 +331,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
 {
 	struct screen_ctx	*sc = mc->sc;
 	struct menu		*mi;
-	struct geom		 xine;
+	struct geom		 area;
 	int			 n, xsave, ysave;
 
 	if (mc->list) {
@@ -374,25 +374,25 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
 		mc->num++;
 	}
 
-	xine = screen_find_xinerama(sc, mc->geom.x, mc->geom.y, CWM_GAP);
-	xine.w += xine.x - Conf.bwidth * 2;
-	xine.h += xine.y - Conf.bwidth * 2;
+	area = screen_area(sc, mc->geom.x, mc->geom.y, CWM_GAP);
+	area.w += area.x - Conf.bwidth * 2;
+	area.h += area.y - Conf.bwidth * 2;
 
 	xsave = mc->geom.x;
 	ysave = mc->geom.y;
 
 	/* Never hide the top, or left side, of the menu. */
-	if (mc->geom.x + mc->geom.w >= xine.w)
-		mc->geom.x = xine.w - mc->geom.w;
-	if (mc->geom.x < xine.x) {
-		mc->geom.x = xine.x;
-		mc->geom.w = MIN(mc->geom.w, (xine.w - xine.x));
+	if (mc->geom.x + mc->geom.w >= area.w)
+		mc->geom.x = area.w - mc->geom.w;
+	if (mc->geom.x < area.x) {
+		mc->geom.x = area.x;
+		mc->geom.w = MIN(mc->geom.w, (area.w - area.x));
 	}
-	if (mc->geom.y + mc->geom.h >= xine.h)
-		mc->geom.y = xine.h - mc->geom.h;
-	if (mc->geom.y < xine.y) {
-		mc->geom.y = xine.y;
-		mc->geom.h = MIN(mc->geom.h, (xine.h - xine.y));
+	if (mc->geom.y + mc->geom.h >= area.h)
+		mc->geom.y = area.h - mc->geom.h;
+	if (mc->geom.y < area.y) {
+		mc->geom.y = area.y;
+		mc->geom.h = MIN(mc->geom.h, (area.h - area.y));
 	}
 
 	if (mc->geom.x != xsave || mc->geom.y != ysave)
@@ -415,7 +415,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
 		int y = n * (sc->xftfont->height + 1) + sc->xftfont->ascent + 1;
 
 		/* Stop drawing when menu doesn't fit inside the screen. */
-		if (mc->geom.y + y > xine.h)
+		if (mc->geom.y + y > area.h)
 			break;
 
 		xu_xft_draw(sc, text, CWM_COLOR_MENU_FONT, 0, y);