1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# 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);
}
}
}
|