summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.c10
-rw-r--r--dwm.h2
-rw-r--r--event.c4
-rw-r--r--main.c4
4 files changed, 11 insertions, 9 deletions
diff --git a/client.c b/client.c
index 0a59c22..f2cd802 100644
--- a/client.c
+++ b/client.c
@@ -85,20 +85,22 @@ focus(Client *c) {
85 grabbuttons(sel, False); 85 grabbuttons(sel, False);
86 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 86 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
87 } 87 }
88 sel = c;
89 if(!issel)
90 return;
91 if(c) { 88 if(c) {
92 detachstack(c); 89 detachstack(c);
93 c->snext = stack; 90 c->snext = stack;
94 stack = c; 91 stack = c;
95 grabbuttons(c, True); 92 grabbuttons(c, True);
93 }
94 sel = c;
95 drawstatus();
96 if(!activescreen)
97 return;
98 if(sel) {
96 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 99 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
97 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 100 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
98 } 101 }
99 else 102 else
100 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 103 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
101 drawstatus();
102} 104}
103 105
104Client * 106Client *
diff --git a/dwm.h b/dwm.h
index 79627bd..72fcacf 100644
--- a/dwm.h
+++ b/dwm.h
@@ -93,7 +93,7 @@ extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
93extern void (*handler[LASTEvent])(XEvent *); /* event handler */ 93extern void (*handler[LASTEvent])(XEvent *); /* event handler */
94extern void (*arrange)(void); /* arrange function, indicates mode */ 94extern void (*arrange)(void); /* arrange function, indicates mode */
95extern Atom wmatom[WMLast], netatom[NetLast]; 95extern Atom wmatom[WMLast], netatom[NetLast];
96extern Bool running, issel, *seltag; /* seltag is array of Bool */ 96extern Bool activescreen, running, *seltag; /* seltag is array of Bool */
97extern Client *clients, *sel, *stack; /* global client list and stack */ 97extern Client *clients, *sel, *stack; /* global client list and stack */
98extern Cursor cursor[CurLast]; 98extern Cursor cursor[CurLast];
99extern DC dc; /* global draw context */ 99extern DC dc; /* global draw context */
diff --git a/event.c b/event.c
index c913320..4f07789 100644
--- a/event.c
+++ b/event.c
@@ -230,7 +230,7 @@ enternotify(XEvent *e) {
230 if((c = getclient(ev->window)) && isvisible(c)) 230 if((c = getclient(ev->window)) && isvisible(c))
231 focus(c); 231 focus(c);
232 else if(ev->window == root) { 232 else if(ev->window == root) {
233 issel = True; 233 activescreen = True;
234 for(c = stack; c && !isvisible(c); c = c->snext); 234 for(c = stack; c && !isvisible(c); c = c->snext);
235 focus(c); 235 focus(c);
236 } 236 }
@@ -269,7 +269,7 @@ 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 issel = False; 272 activescreen = False;
273 focus(NULL); 273 focus(NULL);
274 } 274 }
275} 275}
diff --git a/main.c b/main.c
index ae5d6ef..20c2890 100644
--- a/main.c
+++ b/main.c
@@ -23,7 +23,7 @@ int bh, bmw, screen, sx, sy, sw, sh, wax, way, waw, wah;
23unsigned int master, nmaster, ntags, numlockmask; 23unsigned int master, nmaster, ntags, numlockmask;
24Atom wmatom[WMLast], netatom[NetLast]; 24Atom wmatom[WMLast], netatom[NetLast];
25Bool running = True; 25Bool running = True;
26Bool issel = True; 26Bool activescreen = True;
27Client *clients = NULL; 27Client *clients = NULL;
28Client *sel = NULL; 28Client *sel = NULL;
29Client *stack = NULL; 29Client *stack = NULL;
@@ -156,7 +156,7 @@ setup(void) {
156 dc.gc = XCreateGC(dpy, root, 0, 0); 156 dc.gc = XCreateGC(dpy, root, 0, 0);
157 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 157 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
158 /* multihead support */ 158 /* multihead support */
159 issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); 159 activescreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
160} 160}
161 161
162/* 162/*