diff options
| author | arg@10ksloc.org <unknown> | 2006-07-20 12:18:06 +0200 |
|---|---|---|
| committer | arg@10ksloc.org <unknown> | 2006-07-20 12:18:06 +0200 |
| commit | dc5d967ee61046f899b3b49daeb9268c8161844a (patch) | |
| tree | 012a500412dc2c3a427a658d0f257c39de8351fb /client.c | |
| parent | Added tag 0.4 for changeset eb3165734f00fe7f7da8aeebaed00e60a57caac9 (diff) | |
| download | dwm-dc5d967ee61046f899b3b49daeb9268c8161844a.tar.gz dwm-dc5d967ee61046f899b3b49daeb9268c8161844a.zip | |
cleaned up code
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 16 |
1 files changed, 10 insertions, 6 deletions
| @@ -97,6 +97,7 @@ Client * | |||
| 97 | getclient(Window w) | 97 | getclient(Window w) |
| 98 | { | 98 | { |
| 99 | Client *c; | 99 | Client *c; |
| 100 | |||
| 100 | for(c = clients; c; c = c->next) | 101 | for(c = clients; c; c = c->next) |
| 101 | if(c->win == w) | 102 | if(c->win == w) |
| 102 | return c; | 103 | return c; |
| @@ -107,6 +108,7 @@ Client * | |||
| 107 | getctitle(Window w) | 108 | getctitle(Window w) |
| 108 | { | 109 | { |
| 109 | Client *c; | 110 | Client *c; |
| 111 | |||
| 110 | for(c = clients; c; c = c->next) | 112 | for(c = clients; c; c = c->next) |
| 111 | if(c->title == w) | 113 | if(c->title == w) |
| 112 | return c; | 114 | return c; |
| @@ -198,8 +200,8 @@ manage(Window w, XWindowAttributes *wa) | |||
| 198 | { | 200 | { |
| 199 | int diff; | 201 | int diff; |
| 200 | Client *c; | 202 | Client *c; |
| 201 | XSetWindowAttributes twa; | ||
| 202 | Window trans; | 203 | Window trans; |
| 204 | XSetWindowAttributes twa; | ||
| 203 | 205 | ||
| 204 | c = emallocz(sizeof(Client)); | 206 | c = emallocz(sizeof(Client)); |
| 205 | c->win = w; | 207 | c->win = w; |
| @@ -278,6 +280,7 @@ void | |||
| 278 | pop(Client *c) | 280 | pop(Client *c) |
| 279 | { | 281 | { |
| 280 | Client **l; | 282 | Client **l; |
| 283 | |||
| 281 | for(l = &clients; *l && *l != c; l = &(*l)->next); | 284 | for(l = &clients; *l && *l != c; l = &(*l)->next); |
| 282 | *l = c->next; | 285 | *l = c->next; |
| 283 | 286 | ||
| @@ -289,9 +292,9 @@ pop(Client *c) | |||
| 289 | void | 292 | void |
| 290 | resize(Client *c, Bool inc, Corner sticky) | 293 | resize(Client *c, Bool inc, Corner sticky) |
| 291 | { | 294 | { |
| 292 | XConfigureEvent e; | ||
| 293 | int right = c->x + c->w; | ||
| 294 | int bottom = c->y + c->h; | 295 | int bottom = c->y + c->h; |
| 296 | int right = c->x + c->w; | ||
| 297 | XConfigureEvent e; | ||
| 295 | 298 | ||
| 296 | if(inc) { | 299 | if(inc) { |
| 297 | if(c->incw) | 300 | if(c->incw) |
| @@ -337,8 +340,9 @@ resize(Client *c, Bool inc, Corner sticky) | |||
| 337 | void | 340 | void |
| 338 | setsize(Client *c) | 341 | setsize(Client *c) |
| 339 | { | 342 | { |
| 340 | XSizeHints size; | ||
| 341 | long msize; | 343 | long msize; |
| 344 | XSizeHints size; | ||
| 345 | |||
| 342 | if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) | 346 | if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) |
| 343 | size.flags = PSize; | 347 | size.flags = PSize; |
| 344 | c->flags = size.flags; | 348 | c->flags = size.flags; |
| @@ -375,9 +379,9 @@ setsize(Client *c) | |||
| 375 | void | 379 | void |
| 376 | settitle(Client *c) | 380 | settitle(Client *c) |
| 377 | { | 381 | { |
| 378 | XTextProperty name; | ||
| 379 | int n; | ||
| 380 | char **list = NULL; | 382 | char **list = NULL; |
| 383 | int n; | ||
| 384 | XTextProperty name; | ||
| 381 | 385 | ||
| 382 | name.nitems = 0; | 386 | name.nitems = 0; |
| 383 | c->name[0] = 0; | 387 | c->name[0] = 0; |
