summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-23 12:00:49 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-23 12:00:49 +0100
commit17ec726b494c2ee6e6b5dbe00bb83b2d931b3fc0 (patch)
treed42812e3d2cc53d435abc200b0aa77a7ba331895
parentI think this is the best solution of multihead support (diff)
downloaddwm-17ec726b494c2ee6e6b5dbe00bb83b2d931b3fc0.tar.gz
dwm-17ec726b494c2ee6e6b5dbe00bb83b2d931b3fc0.zip
this version should also work with cornercases (like unmanage during !issel, etc.)
Diffstat (limited to '')
-rw-r--r--client.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/client.c b/client.c
index 5309d0e..5c69718 100644
--- a/client.c
+++ b/client.c
@@ -79,15 +79,16 @@ configure(Client *c) {
79 79
80void 80void
81focus(Client *c) { 81focus(Client *c) {
82 Client *old = sel;
83
84 if(c && !isvisible(c)) 82 if(c && !isvisible(c))
85 return; 83 return;
86 84
87 if(old && old != c) { 85 if(sel && sel != c) {
88 grabbuttons(old, False); 86 grabbuttons(sel, False);
89 XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]); 87 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
90 } 88 }
89 sel = c;
90 if(!issel)
91 return;
91 if(c) { 92 if(c) {
92 detachstack(c); 93 detachstack(c);
93 c->snext = stack; 94 c->snext = stack;
@@ -96,9 +97,8 @@ focus(Client *c) {
96 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 97 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
97 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 98 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
98 } 99 }
99 else if(issel) 100 else
100 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 101 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
101 sel = c;
102 drawstatus(); 102 drawstatus();
103} 103}
104 104