diff options
| author | Anselm R.Garbe <arg@10ksloc.org> | 2006-08-14 10:18:24 +0200 |
|---|---|---|
| committer | Anselm R.Garbe <arg@10ksloc.org> | 2006-08-14 10:18:24 +0200 |
| commit | d4b7a9a3735deeab639f28b5bb2f568e0dc49616 (patch) | |
| tree | 9cff17d7a5d4fa2fe94b39d0d18d8d72c8429736 /client.c | |
| parent | fixed string cutting in draw.c (diff) | |
| download | dwm-d4b7a9a3735deeab639f28b5bb2f568e0dc49616.tar.gz dwm-d4b7a9a3735deeab639f28b5bb2f568e0dc49616.zip | |
implemented restack behavior (floats are on top in tiled mode)
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 26 |
1 files changed, 8 insertions, 18 deletions
| @@ -59,8 +59,6 @@ focus(Client *c) | |||
| 59 | drawtitle(old); | 59 | drawtitle(old); |
| 60 | drawtitle(c); | 60 | drawtitle(c); |
| 61 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); | 61 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); |
| 62 | XSync(dpy, False); | ||
| 63 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 64 | } | 62 | } |
| 65 | 63 | ||
| 66 | void | 64 | void |
| @@ -77,8 +75,8 @@ focusnext(Arg *arg) | |||
| 77 | if(!(c = getnext(sel->next))) | 75 | if(!(c = getnext(sel->next))) |
| 78 | c = getnext(clients); | 76 | c = getnext(clients); |
| 79 | if(c) { | 77 | if(c) { |
| 80 | higher(c); | ||
| 81 | focus(c); | 78 | focus(c); |
| 79 | restack(); | ||
| 82 | } | 80 | } |
| 83 | } | 81 | } |
| 84 | 82 | ||
| @@ -98,8 +96,8 @@ focusprev(Arg *arg) | |||
| 98 | c = getprev(c); | 96 | c = getprev(c); |
| 99 | } | 97 | } |
| 100 | if(c) { | 98 | if(c) { |
| 101 | higher(c); | ||
| 102 | focus(c); | 99 | focus(c); |
| 100 | restack(); | ||
| 103 | } | 101 | } |
| 104 | } | 102 | } |
| 105 | 103 | ||
| @@ -181,13 +179,6 @@ gravitate(Client *c, Bool invert) | |||
| 181 | } | 179 | } |
| 182 | 180 | ||
| 183 | void | 181 | void |
| 184 | higher(Client *c) | ||
| 185 | { | ||
| 186 | XRaiseWindow(dpy, c->win); | ||
| 187 | XRaiseWindow(dpy, c->title); | ||
| 188 | } | ||
| 189 | |||
| 190 | void | ||
| 191 | killclient(Arg *arg) | 182 | killclient(Arg *arg) |
| 192 | { | 183 | { |
| 193 | if(!sel) | 184 | if(!sel) |
| @@ -271,13 +262,12 @@ manage(Window w, XWindowAttributes *wa) | |||
| 271 | || (c->maxw && c->minw && | 262 | || (c->maxw && c->minw && |
| 272 | c->maxw == c->minw && c->maxh == c->minh); | 263 | c->maxw == c->minw && c->maxh == c->minh); |
| 273 | settitle(c); | 264 | settitle(c); |
| 274 | arrange(NULL); | ||
| 275 | 265 | ||
| 276 | /* mapping the window now prevents flicker */ | 266 | XMapWindow(dpy, c->win); |
| 277 | XMapRaised(dpy, c->win); | 267 | XMapWindow(dpy, c->title); |
| 278 | XMapRaised(dpy, c->title); | ||
| 279 | if(isvisible(c)) | 268 | if(isvisible(c)) |
| 280 | focus(c); | 269 | focus(c); |
| 270 | arrange(NULL); | ||
| 281 | } | 271 | } |
| 282 | 272 | ||
| 283 | void | 273 | void |
| @@ -410,7 +400,7 @@ togglemax(Arg *arg) | |||
| 410 | sel->w = sw - 2; | 400 | sel->w = sw - 2; |
| 411 | sel->h = sh - 2 - bh; | 401 | sel->h = sh - 2 - bh; |
| 412 | 402 | ||
| 413 | higher(sel); | 403 | restack(); |
| 414 | resize(sel, arrange == dofloat, TopLeft); | 404 | resize(sel, arrange == dofloat, TopLeft); |
| 415 | 405 | ||
| 416 | sel->x = ox; | 406 | sel->x = ox; |
| @@ -446,9 +436,9 @@ unmanage(Client *c) | |||
| 446 | XSync(dpy, False); | 436 | XSync(dpy, False); |
| 447 | XSetErrorHandler(xerror); | 437 | XSetErrorHandler(xerror); |
| 448 | XUngrabServer(dpy); | 438 | XUngrabServer(dpy); |
| 449 | arrange(NULL); | ||
| 450 | if(sel) | 439 | if(sel) |
| 451 | focus(sel); | 440 | focus(sel); |
| 441 | arrange(NULL); | ||
| 452 | } | 442 | } |
| 453 | 443 | ||
| 454 | void | 444 | void |
| @@ -474,6 +464,6 @@ zoom(Arg *arg) | |||
| 474 | clients->prev = sel; | 464 | clients->prev = sel; |
| 475 | sel->next = clients; | 465 | sel->next = clients; |
| 476 | clients = sel; | 466 | clients = sel; |
| 477 | arrange(NULL); | ||
| 478 | focus(sel); | 467 | focus(sel); |
| 468 | arrange(NULL); | ||
| 479 | } | 469 | } |
