From 9fa5ca353801e3537cea354103c3d5a6a53ef76a Mon Sep 17 00:00:00 2001 From: Anselm R Garbe Date: Mon, 17 Mar 2008 16:29:50 +0000 Subject: renamed c->border into c->bw, fixed monocle to subtract c->bw from each h/w value --- dwm.c | 68 +++++++++++++++++++++++++++++++++---------------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 6b46911..533632a 100644 --- a/dwm.c +++ b/dwm.c @@ -69,7 +69,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh; int minax, maxax, minay, maxay; long flags; - unsigned int border, oldborder; + unsigned int bw, oldbw; Bool isbanned, isfixed, isfloating, isurgent; Bool *tags; Client *next; @@ -413,7 +413,7 @@ configure(Client *c) { ce.y = c->y; ce.width = c->w; ce.height = c->h; - ce.border_width = c->border; + ce.border_width = c->bw; ce.above = None; ce.override_redirect = False; XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); @@ -435,7 +435,7 @@ configurerequest(XEvent *e) { if((c = getclient(ev->window))) { if(ev->value_mask & CWBorderWidth) - c->border = ev->border_width; + c->bw = ev->border_width; if(c->isfixed || c->isfloating || lt->isfloating) { if(ev->value_mask & CWX) c->x = sx + ev->x; @@ -1000,25 +1000,25 @@ manage(Window w, XWindowAttributes *wa) { c->y = wa->y; c->w = wa->width; c->h = wa->height; - c->oldborder = wa->border_width; + c->oldbw = wa->border_width; if(c->w == sw && c->h == sh) { c->x = sx; c->y = sy; - c->border = wa->border_width; + c->bw = wa->border_width; } else { - if(c->x + c->w + 2 * c->border > wx + ww) - c->x = wx + ww - c->w - 2 * c->border; - if(c->y + c->h + 2 * c->border > wy + wh) - c->y = wy + wh - c->h - 2 * c->border; + if(c->x + c->w + 2 * c->bw > wx + ww) + c->x = wx + ww - c->w - 2 * c->bw; + if(c->y + c->h + 2 * c->bw > wy + wh) + c->y = wy + wh - c->h - 2 * c->bw; if(c->x < wx) c->x = wx; if(c->y < wy) c->y = wy; - c->border = BORDERPX; + c->bw = BORDERPX; } - wc.border_width = c->border; + wc.border_width = c->bw; XConfigureWindow(dpy, w, CWBorderWidth, &wc); XSetWindowBorder(dpy, w, dc.norm[ColBorder]); configure(c); /* propagates border_width, if size doesn't change */ @@ -1071,7 +1071,7 @@ monocle(void) { for(c = clients; c; c = c->next) if(isvisible(c)) - resize(c, mox, moy, mow, moh, RESIZEHINTS); + resize(c, mox, moy, mow - 2 * c->bw, moh - 2 * c->bw, RESIZEHINTS); } void @@ -1104,12 +1104,12 @@ movemouse(Client *c) { ny = ocy + (ev.xmotion.y - y1); if(abs(wx - nx) < SNAP) nx = wx; - else if(abs((wx + ww) - (nx + c->w + 2 * c->border)) < SNAP) - nx = wx + ww - c->w - 2 * c->border; + else if(abs((wx + ww) - (nx + c->w + 2 * c->bw)) < SNAP) + nx = wx + ww - c->w - 2 * c->bw; if(abs(wy - ny) < SNAP) ny = wy; - else if(abs((wy + wh) - (ny + c->h + 2 * c->border)) < SNAP) - ny = wy + wh - c->h - 2 * c->border; + else if(abs((wy + wh) - (ny + c->h + 2 * c->bw)) < SNAP) + ny = wy + wh - c->h - 2 * c->bw; if(!c->isfloating && !lt->isfloating && (abs(nx - c->x) > SNAP || abs(ny - c->y) > SNAP)) togglefloating(NULL); if((lt->isfloating) || c->isfloating) @@ -1219,19 +1219,19 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { if(w <= 0 || h <= 0) return; if(x > sx + sw) - x = sw - w - 2 * c->border; + x = sw - w - 2 * c->bw; if(y > sy + sh) - y = sh - h - 2 * c->border; - if(x + w + 2 * c->border < sx) + y = sh - h - 2 * c->bw; + if(x + w + 2 * c->bw < sx) x = sx; - if(y + h + 2 * c->border < sy) + if(y + h + 2 * c->bw < sy) y = sy; if(c->x != x || c->y != y || c->w != w || c->h != h) { c->x = wc.x = x; c->y = wc.y = y; c->w = wc.width = w; c->h = wc.height = h; - wc.border_width = c->border; + wc.border_width = c->bw; XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); @@ -1250,13 +1250,13 @@ resizemouse(Client *c) { if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, cursor[CurResize], CurrentTime) != GrabSuccess) return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->border - 1, c->h + c->border - 1); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); for(;;) { XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask , &ev); switch(ev.type) { case ButtonRelease: XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, - c->w + c->border - 1, c->h + c->border - 1); + c->w + c->bw - 1, c->h + c->bw - 1); XUngrabPointer(dpy, CurrentTime); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); return; @@ -1267,9 +1267,9 @@ resizemouse(Client *c) { break; case MotionNotify: XSync(dpy, False); - if((nw = ev.xmotion.x - ocx - 2 * c->border + 1) <= 0) + if((nw = ev.xmotion.x - ocx - 2 * c->bw + 1) <= 0) nw = 1; - if((nh = ev.xmotion.y - ocy - 2 * c->border + 1) <= 0) + if((nh = ev.xmotion.y - ocy - 2 * c->bw + 1) <= 0) nh = 1; if(!c->isfloating && !lt->isfloating && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP)) togglefloating(NULL); @@ -1608,11 +1608,11 @@ tileh(void) { for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { if(i + 1 == n) /* remainder */ - tileresize(c, x, ty, (tx + tw) - x - 2 * c->border, th - 2 * c->border); + tileresize(c, x, ty, (tx + tw) - x - 2 * c->bw, th - 2 * c->bw); else - tileresize(c, x, ty, w - 2 * c->border, th - 2 * c->border); + tileresize(c, x, ty, w - 2 * c->bw, th - 2 * c->bw); if(w != tw) - x = c->x + c->w + 2 * c->border; + x = c->x + c->w + 2 * c->bw; } } @@ -1621,9 +1621,9 @@ tilemaster(unsigned int n) { Client *c = nexttiled(clients); if(n == 1) - tileresize(c, mox, moy, mow - 2 * c->border, moh - 2 * c->border); + tileresize(c, mox, moy, mow - 2 * c->bw, moh - 2 * c->bw); else - tileresize(c, mx, my, mw - 2 * c->border, mh - 2 * c->border); + tileresize(c, mx, my, mw - 2 * c->bw, mh - 2 * c->bw); return c; } @@ -1654,11 +1654,11 @@ tilev(void) { for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { if(i + 1 == n) /* remainder */ - tileresize(c, tx, y, tw - 2 * c->border, (ty + th) - y - 2 * c->border); + tileresize(c, tx, y, tw - 2 * c->bw, (ty + th) - y - 2 * c->bw); else - tileresize(c, tx, y, tw - 2 * c->border, h - 2 * c->border); + tileresize(c, tx, y, tw - 2 * c->bw, h - 2 * c->bw); if(h != th) - y = c->y + c->h + 2 * c->border; + y = c->y + c->h + 2 * c->bw; } } @@ -1710,7 +1710,7 @@ void unmanage(Client *c) { XWindowChanges wc; - wc.border_width = c->oldborder; + wc.border_width = c->oldbw; /* The server grab construct avoids race conditions. */ XGrabServer(dpy); XSetErrorHandler(xerrordummy); -- cgit 1.4.1-2-gfad0 /023boolean.cc?h=hlt&id=a0d7a15594990974808cc613a4814d1f86471b5e'>^
6c96a437 ^
4e49b29e ^
9dcbec39 ^
4e49b29e ^


bff0fa45 ^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
23d3a022 ^
0487a30e ^
827898fc ^
98f7918b ^

23d3a022 ^





98f7918b ^
4a943d4e ^











98f7918b ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
1848b18f ^

98f7918b ^
795f5244 ^
e236973b ^
4e49b29e ^
6c96a437 ^
4e49b29e ^
9dcbec39 ^
4e49b29e ^


bff0fa45 ^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
23d3a022 ^
0487a30e ^
827898fc ^
98f7918b ^


4a943d4e ^












d7e11237 ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
1848b18f ^

d7e11237 ^
795f5244 ^
e236973b ^
4e49b29e ^
67a180e3 ^
2b250717 ^
4e49b29e ^

6c96a437 ^
23d3a022 ^

4e49b29e ^


6c96a437 ^
bff0fa45 ^

9dcbec39 ^
bff0fa45 ^


4e49b29e ^

d7e11237 ^

e4630643 ^
6c96a437 ^
23d3a022 ^
0487a30e ^
d7e11237 ^


4a943d4e ^











0487a30e ^
4a943d4e ^











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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224