summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c20
-rw-r--r--event.c2
2 files changed, 13 insertions, 9 deletions
diff --git a/client.c b/client.c
index 177eb94..510ec59 100644
--- a/client.c
+++ b/client.c
@@ -81,7 +81,7 @@ void
81focus(Client *c) { 81focus(Client *c) {
82 Client *old = sel; 82 Client *old = sel;
83 83
84 if(!issel || (c && !isvisible(c))) 84 if(c && !isvisible(c))
85 return; 85 return;
86 86
87 if(old && old != c) { 87 if(old && old != c) {
@@ -89,14 +89,18 @@ focus(Client *c) {
89 XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]); 89 XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]);
90 } 90 }
91 if(c) { 91 if(c) {
92 detachstack(c); 92 if(issel) {
93 c->snext = stack; 93 detachstack(c);
94 stack = c; 94 c->snext = stack;
95 grabbuttons(c, True); 95 stack = c;
96 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 96 grabbuttons(c, True);
97 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 97 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
98 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
99 }
100 else
101 XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
98 } 102 }
99 else 103 else if(issel)
100 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 104 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
101 sel = c; 105 sel = c;
102 drawstatus(); 106 drawstatus();
diff --git a/event.c b/event.c
index e0718d3..2e021d5 100644
--- a/event.c
+++ b/event.c
@@ -269,8 +269,8 @@ leavenotify(XEvent *e) {
269 XCrossingEvent *ev = &e->xcrossing; 269 XCrossingEvent *ev = &e->xcrossing;
270 270
271 if((ev->window == root) && !ev->same_screen) { 271 if((ev->window == root) && !ev->same_screen) {
272 focus(NULL);
273 issel = False; 272 issel = False;
273 focus(sel);
274 } 274 }
275} 275}
276 276