summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/client.c b/client.c
index 5be438e..ecfd8f0 100644
--- a/client.c
+++ b/client.c
@@ -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
66void 64void
@@ -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
183void 181void
184higher(Client *c)
185{
186 XRaiseWindow(dpy, c->win);
187 XRaiseWindow(dpy, c->title);
188}
189
190void
191killclient(Arg *arg) 182killclient(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
283void 273void
@@ -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
454void 444void
@@ -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}