--- gntwm.c	2021-09-26 11:56:33.000000000 +0800
+++ gntwm.c	2024-05-23 05:20:08.000000000 +0800
@@ -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);
 				}
 			}
 		}
