about summary refs log tree commit diff stats
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) {
 		grabbuttons(sel, False);
 		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
 	}
-	sel = c;
-	if(!issel)
-		return;
 	if(c) {
 		detachstack(c);
 		c->snext = stack;
 		stack = c;
 		grabbuttons(c, True);
+	}
+	sel = c;
+	drawstatus();
+	if(!activescreen)
+		return;
+	if(sel) {
 		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
 		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
 	}
 	else
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-	drawstatus();
 }
 
 Client *
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 */
 extern void (*handler[LASTEvent])(XEvent *);	/* event handler */
 extern void (*arrange)(void);			/* arrange function, indicates mode  */
 extern Atom wmatom[WMLast], netatom[NetLast];
-extern Bool running, issel, *seltag;		/* seltag is array of Bool */
+extern Bool activescreen, running, *seltag;		/* seltag is array of Bool */
 extern Client *clients, *sel, *stack;		/* global client list and stack */
 extern Cursor cursor[CurLast];
 extern 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) {
 	if((c = getclient(ev->window)) && isvisible(c))
 		focus(c);
 	else if(ev->window == root) {
-		issel = True;
+		activescreen = True;
 		for(c = stack; c && !isvisible(c); c = c->snext);
 		focus(c);
 	}
@@ -269,7 +269,7 @@ leavenotify(XEvent *e) {
 	XCrossingEvent *ev = &e->xcrossing;
 
 	if((ev->window == root) && !ev->same_screen) {
-		issel = False;
+		activescreen = False;
 		focus(NULL);
 	}
 }
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;
 unsigned int master, nmaster, ntags, numlockmask;
 Atom wmatom[WMLast], netatom[NetLast];
 Bool running = True;
-Bool issel = True;
+Bool activescreen = True;
 Client *clients = NULL;
 Client *sel = NULL;
 Client *stack = NULL;
@@ -156,7 +156,7 @@ setup(void) {
 	dc.gc = XCreateGC(dpy, root, 0, 0);
 	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
 	/* multihead support */
-	issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
+	activescreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
 }
 
 /*
id='n266' href='#n266'>266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365