summaryrefslogblamecommitdiff
path: root/user/libgnt/ncurses.patch
blob: 0d91c2dbf411b7e57115a3e5eb13135798bb9ab6 (plain) (tree)





























































                                                                                                                              
# HG changeset patch
# Node ID 7c4e8ad1e3c7
# Parent  73d8724225e7
diff --git a/gntwm.c b/gntwm.c
--- a/gntwm.c
+++ b/gntwm.c
@@ -166,38 +166,40 @@
 		int sx, ex, sy, ey, w, y;
 		cchar_t ch;
 		PANEL *below = panel;
+		WINDOW *window = panel_window(panel);
 
-		sx = getbegx(panel->win);
-		ex = getmaxx(panel->win) + sx;
-		sy = getbegy(panel->win);
-		ey = getmaxy(panel->win) + sy;
+		sx = getbegx(window);
+		ex = getmaxx(window) + sx;
+		sy = getbegy(window);
+		ey = getmaxy(window) + sy;
 
 		while ((below = panel_below(below)) != NULL) {
-			if (sy > getbegy(below->win) + getmaxy(below->win) ||
-					ey < getbegy(below->win))
+			window = panel_window(below);
+			if (sy > getbegy(window) + getmaxy(window) ||
+					ey < getbegy(window))
 				continue;
-			if (sx > getbegx(below->win) + getmaxx(below->win) ||
-					ex < getbegx(below->win))
+			if (sx > getbegx(window) + getmaxx(window) ||
+					ex < getbegx(window))
 				continue;
-			for (y = MAX(sy, getbegy(below->win)); y <= MIN(ey, getbegy(below->win) + getmaxy(below->win)); y++) {
-				if (mvwin_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch) != OK)
+			for (y = MAX(sy, getbegy(window)); y <= MIN(ey, getbegy(window) + getmaxy(window)); y++) {
+				if (mvwin_wch(window, y - getbegy(window), sx - 1 - getbegx(window), &ch) != OK)
 					goto right;
 				w = widestringwidth(ch.chars);
 				if (w > 1 && (ch.attr & 1)) {
 					ch.chars[0] = ' ';
 					ch.attr &= ~ A_CHARTEXT;
-					mvwadd_wch(below->win, y - getbegy(below->win), sx - 1 - getbegx(below->win), &ch);
-					touchline(below->win, y - getbegy(below->win), 1);
+					mvwadd_wch(window, y - getbegy(window), sx - 1 - getbegx(window), &ch);
+					touchline(window, y - getbegy(window), 1);
 				}
 right:
-				if (mvwin_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch) != OK)
+				if (mvwin_wch(window, y - getbegy(window), ex + 1 - getbegx(window), &ch) != OK)
 					continue;
 				w = widestringwidth(ch.chars);
 				if (w > 1 && !(ch.attr & 1)) {
 					ch.chars[0] = ' ';
 					ch.attr &= ~ A_CHARTEXT;
-					mvwadd_wch(below->win, y - getbegy(below->win), ex + 1 - getbegx(below->win), &ch);
-					touchline(below->win, y - getbegy(below->win), 1);
+					mvwadd_wch(window, y - getbegy(window), ex + 1 - getbegx(window), &ch);
+					touchline(window, y - getbegy(window), 1);
 				}
 			}
 		}