diff options
| author | Anselm R. Garbe <arg@10kloc.org> | 2006-09-12 10:57:28 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@10kloc.org> | 2006-09-12 10:57:28 +0200 |
| commit | ca65478c8968434c78aacf4a102ccbbe4a66ad9e (patch) | |
| tree | a7b8e02be5fb457e1c3f0e646e212911048390b6 /client.c | |
| parent | some more simplifications of intro comment in dwm.h, this should suffice for ... (diff) | |
| download | dwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.tar.gz dwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.zip | |
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 50 |
1 files changed, 16 insertions, 34 deletions
| @@ -11,16 +11,14 @@ | |||
| 11 | /* static functions */ | 11 | /* static functions */ |
| 12 | 12 | ||
| 13 | static void | 13 | static void |
| 14 | detachstack(Client *c) | 14 | detachstack(Client *c) { |
| 15 | { | ||
| 16 | Client **tc; | 15 | Client **tc; |
| 17 | for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext); | 16 | for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext); |
| 18 | *tc = c->snext; | 17 | *tc = c->snext; |
| 19 | } | 18 | } |
| 20 | 19 | ||
| 21 | static void | 20 | static void |
| 22 | grabbuttons(Client *c, Bool focused) | 21 | grabbuttons(Client *c, Bool focused) { |
| 23 | { | ||
| 24 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); | 22 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); |
| 25 | 23 | ||
| 26 | if(focused) { | 24 | if(focused) { |
| @@ -54,12 +52,10 @@ grabbuttons(Client *c, Bool focused) | |||
| 54 | else | 52 | else |
| 55 | XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK, | 53 | XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK, |
| 56 | GrabModeAsync, GrabModeSync, None, None); | 54 | GrabModeAsync, GrabModeSync, None, None); |
| 57 | |||
| 58 | } | 55 | } |
| 59 | 56 | ||
| 60 | static void | 57 | static void |
| 61 | resizetitle(Client *c) | 58 | resizetitle(Client *c) { |
| 62 | { | ||
| 63 | c->tw = textw(c->name); | 59 | c->tw = textw(c->name); |
| 64 | if(c->tw > c->w) | 60 | if(c->tw > c->w) |
| 65 | c->tw = c->w + 2; | 61 | c->tw = c->w + 2; |
| @@ -69,27 +65,23 @@ resizetitle(Client *c) | |||
| 69 | XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); | 65 | XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); |
| 70 | else | 66 | else |
| 71 | XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); | 67 | XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); |
| 72 | |||
| 73 | } | 68 | } |
| 74 | 69 | ||
| 75 | static int | 70 | static int |
| 76 | xerrordummy(Display *dsply, XErrorEvent *ee) | 71 | xerrordummy(Display *dsply, XErrorEvent *ee) { |
| 77 | { | ||
| 78 | return 0; | 72 | return 0; |
| 79 | } | 73 | } |
| 80 | 74 | ||
| 81 | /* extern functions */ | 75 | /* extern functions */ |
| 82 | 76 | ||
| 83 | void | 77 | void |
| 84 | ban(Client *c) | 78 | ban(Client *c) { |
| 85 | { | ||
| 86 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 79 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
| 87 | XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty); | 80 | XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty); |
| 88 | } | 81 | } |
| 89 | 82 | ||
| 90 | void | 83 | void |
| 91 | focus(Client *c) | 84 | focus(Client *c) { |
| 92 | { | ||
| 93 | Client *old; | 85 | Client *old; |
| 94 | 86 | ||
| 95 | if(!issel) | 87 | if(!issel) |
| @@ -119,8 +111,7 @@ focus(Client *c) | |||
| 119 | } | 111 | } |
| 120 | 112 | ||
| 121 | Client * | 113 | Client * |
| 122 | getclient(Window w) | 114 | getclient(Window w) { |
| 123 | { | ||
| 124 | Client *c; | 115 | Client *c; |
| 125 | 116 | ||
| 126 | for(c = clients; c; c = c->next) | 117 | for(c = clients; c; c = c->next) |
| @@ -130,8 +121,7 @@ getclient(Window w) | |||
| 130 | } | 121 | } |
| 131 | 122 | ||
| 132 | Client * | 123 | Client * |
| 133 | getctitle(Window w) | 124 | getctitle(Window w) { |
| 134 | { | ||
| 135 | Client *c; | 125 | Client *c; |
| 136 | 126 | ||
| 137 | for(c = clients; c; c = c->next) | 127 | for(c = clients; c; c = c->next) |
| @@ -141,8 +131,7 @@ getctitle(Window w) | |||
| 141 | } | 131 | } |
| 142 | 132 | ||
| 143 | void | 133 | void |
| 144 | gravitate(Client *c, Bool invert) | 134 | gravitate(Client *c, Bool invert) { |
| 145 | { | ||
| 146 | int dx = 0, dy = 0; | 135 | int dx = 0, dy = 0; |
| 147 | 136 | ||
| 148 | switch(c->grav) { | 137 | switch(c->grav) { |
| @@ -196,8 +185,7 @@ gravitate(Client *c, Bool invert) | |||
| 196 | } | 185 | } |
| 197 | 186 | ||
| 198 | void | 187 | void |
| 199 | killclient(Arg *arg) | 188 | killclient(Arg *arg) { |
| 200 | { | ||
| 201 | if(!sel) | 189 | if(!sel) |
| 202 | return; | 190 | return; |
| 203 | if(sel->proto & PROTODELWIN) | 191 | if(sel->proto & PROTODELWIN) |
| @@ -207,8 +195,7 @@ killclient(Arg *arg) | |||
| 207 | } | 195 | } |
| 208 | 196 | ||
| 209 | void | 197 | void |
| 210 | manage(Window w, XWindowAttributes *wa) | 198 | manage(Window w, XWindowAttributes *wa) { |
| 211 | { | ||
| 212 | Client *c; | 199 | Client *c; |
| 213 | Window trans; | 200 | Window trans; |
| 214 | XSetWindowAttributes twa; | 201 | XSetWindowAttributes twa; |
| @@ -270,8 +257,7 @@ manage(Window w, XWindowAttributes *wa) | |||
| 270 | } | 257 | } |
| 271 | 258 | ||
| 272 | void | 259 | void |
| 273 | resize(Client *c, Bool sizehints, Corner sticky) | 260 | resize(Client *c, Bool sizehints, Corner sticky) { |
| 274 | { | ||
| 275 | int bottom = c->y + c->h; | 261 | int bottom = c->y + c->h; |
| 276 | int right = c->x + c->w; | 262 | int right = c->x + c->w; |
| 277 | XWindowChanges wc; | 263 | XWindowChanges wc; |
| @@ -309,8 +295,7 @@ resize(Client *c, Bool sizehints, Corner sticky) | |||
| 309 | } | 295 | } |
| 310 | 296 | ||
| 311 | void | 297 | void |
| 312 | updatesize(Client *c) | 298 | updatesize(Client *c) { |
| 313 | { | ||
| 314 | long msize; | 299 | long msize; |
| 315 | XSizeHints size; | 300 | XSizeHints size; |
| 316 | 301 | ||
| @@ -348,8 +333,7 @@ updatesize(Client *c) | |||
| 348 | } | 333 | } |
| 349 | 334 | ||
| 350 | void | 335 | void |
| 351 | updatetitle(Client *c) | 336 | updatetitle(Client *c) { |
| 352 | { | ||
| 353 | char **list = NULL; | 337 | char **list = NULL; |
| 354 | int n; | 338 | int n; |
| 355 | XTextProperty name; | 339 | XTextProperty name; |
| @@ -376,8 +360,7 @@ updatetitle(Client *c) | |||
| 376 | } | 360 | } |
| 377 | 361 | ||
| 378 | void | 362 | void |
| 379 | togglemax(Arg *arg) | 363 | togglemax(Arg *arg) { |
| 380 | { | ||
| 381 | int ox, oy, ow, oh; | 364 | int ox, oy, ow, oh; |
| 382 | Client *c; | 365 | Client *c; |
| 383 | XEvent ev; | 366 | XEvent ev; |
| @@ -412,8 +395,7 @@ togglemax(Arg *arg) | |||
| 412 | } | 395 | } |
| 413 | 396 | ||
| 414 | void | 397 | void |
| 415 | unmanage(Client *c) | 398 | unmanage(Client *c) { |
| 416 | { | ||
| 417 | Client *nc; | 399 | Client *nc; |
| 418 | 400 | ||
| 419 | XGrabServer(dpy); | 401 | XGrabServer(dpy); |
