diff options
| author | Anselm R. Garbe <arg@10kloc.org> | 2006-10-06 11:50:15 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@10kloc.org> | 2006-10-06 11:50:15 +0200 |
| commit | 6651dd7fd9e8e95cfc6c472f1adfeff41735d798 (patch) | |
| tree | 2ba87a8d0df487298c1507de1ec4b26867e0dd19 /client.c | |
| parent | yet another small fix and simplification of dotile (diff) | |
| download | dwm-6651dd7fd9e8e95cfc6c472f1adfeff41735d798.tar.gz dwm-6651dd7fd9e8e95cfc6c472f1adfeff41735d798.zip | |
code polishing, removed unnecessary newlines
Diffstat (limited to '')
| -rw-r--r-- | client.c | 18 |
1 files changed, 1 insertions, 17 deletions
| @@ -1,5 +1,4 @@ | |||
| 1 | /* | 1 | /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
| 2 | * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | ||
| 3 | * See LICENSE file for license details. | 2 | * See LICENSE file for license details. |
| 4 | */ | 3 | */ |
| 5 | #include "dwm.h" | 4 | #include "dwm.h" |
| @@ -156,7 +155,6 @@ gravitate(Client *c, Bool invert) { | |||
| 156 | dy = -(c->h); | 155 | dy = -(c->h); |
| 157 | break; | 156 | break; |
| 158 | } | 157 | } |
| 159 | |||
| 160 | switch (c->grav) { | 158 | switch (c->grav) { |
| 161 | default: | 159 | default: |
| 162 | break; | 160 | break; |
| @@ -177,7 +175,6 @@ gravitate(Client *c, Bool invert) { | |||
| 177 | dx = -(c->w + c->border); | 175 | dx = -(c->w + c->border); |
| 178 | break; | 176 | break; |
| 179 | } | 177 | } |
| 180 | |||
| 181 | if(invert) { | 178 | if(invert) { |
| 182 | dx = -dx; | 179 | dx = -dx; |
| 183 | dy = -dy; | 180 | dy = -dy; |
| @@ -210,10 +207,8 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 210 | c->w = c->tw = wa->width; | 207 | c->w = c->tw = wa->width; |
| 211 | c->h = wa->height; | 208 | c->h = wa->height; |
| 212 | c->th = bh; | 209 | c->th = bh; |
| 213 | |||
| 214 | c->border = 0; | 210 | c->border = 0; |
| 215 | updatesize(c); | 211 | updatesize(c); |
| 216 | |||
| 217 | if(c->x + c->w + 2 * BORDERPX > sw) | 212 | if(c->x + c->w + 2 * BORDERPX > sw) |
| 218 | c->x = sw - c->w - 2 * BORDERPX; | 213 | c->x = sw - c->w - 2 * BORDERPX; |
| 219 | if(c->x < sx) | 214 | if(c->x < sx) |
| @@ -222,7 +217,6 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 222 | c->y = sh - c->h - 2 * BORDERPX; | 217 | c->y = sh - c->h - 2 * BORDERPX; |
| 223 | if(c->h != sh && c->y < bh) | 218 | if(c->h != sh && c->y < bh) |
| 224 | c->y = bh; | 219 | c->y = bh; |
| 225 | |||
| 226 | c->proto = getproto(c->win); | 220 | c->proto = getproto(c->win); |
| 227 | XSelectInput(dpy, c->win, | 221 | XSelectInput(dpy, c->win, |
| 228 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); | 222 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
| @@ -230,12 +224,10 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 230 | twa.override_redirect = 1; | 224 | twa.override_redirect = 1; |
| 231 | twa.background_pixmap = ParentRelative; | 225 | twa.background_pixmap = ParentRelative; |
| 232 | twa.event_mask = ExposureMask | EnterWindowMask; | 226 | twa.event_mask = ExposureMask | EnterWindowMask; |
| 233 | |||
| 234 | c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, | 227 | c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, |
| 235 | 0, DefaultDepth(dpy, screen), CopyFromParent, | 228 | 0, DefaultDepth(dpy, screen), CopyFromParent, |
| 236 | DefaultVisual(dpy, screen), | 229 | DefaultVisual(dpy, screen), |
| 237 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); | 230 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); |
| 238 | |||
| 239 | grabbuttons(c, False); | 231 | grabbuttons(c, False); |
| 240 | updatetitle(c); | 232 | updatetitle(c); |
| 241 | settags(c, getclient(trans)); | 233 | settags(c, getclient(trans)); |
| @@ -244,13 +236,11 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 244 | || (c->maxw && c->minw && | 236 | || (c->maxw && c->minw && |
| 245 | c->maxw == c->minw && c->maxh == c->minh); | 237 | c->maxw == c->minw && c->maxh == c->minh); |
| 246 | resizetitle(c); | 238 | resizetitle(c); |
| 247 | |||
| 248 | if(clients) | 239 | if(clients) |
| 249 | clients->prev = c; | 240 | clients->prev = c; |
| 250 | c->next = clients; | 241 | c->next = clients; |
| 251 | c->snext = stack; | 242 | c->snext = stack; |
| 252 | stack = clients = c; | 243 | stack = clients = c; |
| 253 | |||
| 254 | ban(c); | 244 | ban(c); |
| 255 | XMapWindow(dpy, c->win); | 245 | XMapWindow(dpy, c->win); |
| 256 | XMapWindow(dpy, c->twin); | 246 | XMapWindow(dpy, c->twin); |
| @@ -283,7 +273,6 @@ resize(Client *c, Bool sizehints, Corner sticky) { | |||
| 283 | c->x = right - c->w; | 273 | c->x = right - c->w; |
| 284 | if(sticky == BotLeft || sticky == BotRight) | 274 | if(sticky == BotLeft || sticky == BotRight) |
| 285 | c->y = bottom - c->h; | 275 | c->y = bottom - c->h; |
| 286 | |||
| 287 | /* offscreen appearance fixes */ | 276 | /* offscreen appearance fixes */ |
| 288 | if(c->x + c->w < sx) | 277 | if(c->x + c->w < sx) |
| 289 | c->x = sx; | 278 | c->x = sx; |
| @@ -293,7 +282,6 @@ resize(Client *c, Bool sizehints, Corner sticky) { | |||
| 293 | c->x = sw - c->w; | 282 | c->x = sw - c->w; |
| 294 | if(c->y > sh) | 283 | if(c->y > sh) |
| 295 | c->y = sh - c->h; | 284 | c->y = sh - c->h; |
| 296 | |||
| 297 | resizetitle(c); | 285 | resizetitle(c); |
| 298 | wc.x = c->x; | 286 | wc.x = c->x; |
| 299 | wc.y = c->y; | 287 | wc.y = c->y; |
| @@ -392,20 +380,16 @@ unmanage(Client *c) { | |||
| 392 | /* The server grab construct avoids race conditions. */ | 380 | /* The server grab construct avoids race conditions. */ |
| 393 | XGrabServer(dpy); | 381 | XGrabServer(dpy); |
| 394 | XSetErrorHandler(xerrordummy); | 382 | XSetErrorHandler(xerrordummy); |
| 395 | |||
| 396 | detach(c); | 383 | detach(c); |
| 397 | detachstack(c); | 384 | detachstack(c); |
| 398 | if(sel == c) { | 385 | if(sel == c) { |
| 399 | for(nc = stack; nc && !isvisible(nc); nc = nc->snext); | 386 | for(nc = stack; nc && !isvisible(nc); nc = nc->snext); |
| 400 | focus(nc); | 387 | focus(nc); |
| 401 | } | 388 | } |
| 402 | |||
| 403 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); | 389 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); |
| 404 | XDestroyWindow(dpy, c->twin); | 390 | XDestroyWindow(dpy, c->twin); |
| 405 | |||
| 406 | free(c->tags); | 391 | free(c->tags); |
| 407 | free(c); | 392 | free(c); |
| 408 | |||
| 409 | XSync(dpy, False); | 393 | XSync(dpy, False); |
| 410 | XSetErrorHandler(xerror); | 394 | XSetErrorHandler(xerror); |
| 411 | XUngrabServer(dpy); | 395 | XUngrabServer(dpy); |
