small changes 71b84c21
Anselm R. Garbe · 2007-01-23 12:29 4 file(s) · +11 −9
client.c +6 −4
85 85
		grabbuttons(sel, False);
86 86
		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
87 87
	}
88 -
	sel = c;
89 -
	if(!issel)
90 -
		return;
91 88
	if(c) {
92 89
		detachstack(c);
93 90
		c->snext = stack;
94 91
		stack = c;
95 92
		grabbuttons(c, True);
93 +
	}
94 +
	sel = c;
95 +
	drawstatus();
96 +
	if(!activescreen)
97 +
		return;
98 +
	if(sel) {
96 99
		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
97 100
		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
98 101
	}
99 102
	else
100 103
		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
101 -
	drawstatus();
102 104
}
103 105
104 106
Client *
dwm.h +1 −1
93 93
extern void (*handler[LASTEvent])(XEvent *);	/* event handler */
94 94
extern void (*arrange)(void);			/* arrange function, indicates mode  */
95 95
extern Atom wmatom[WMLast], netatom[NetLast];
96 -
extern Bool running, issel, *seltag;		/* seltag is array of Bool */
96 +
extern Bool activescreen, running, *seltag;		/* seltag is array of Bool */
97 97
extern Client *clients, *sel, *stack;		/* global client list and stack */
98 98
extern Cursor cursor[CurLast];
99 99
extern DC dc;					/* global draw context */
event.c +2 −2
230 230
	if((c = getclient(ev->window)) && isvisible(c))
231 231
		focus(c);
232 232
	else if(ev->window == root) {
233 -
		issel = True;
233 +
		activescreen = True;
234 234
		for(c = stack; c && !isvisible(c); c = c->snext);
235 235
		focus(c);
236 236
	}
269 269
	XCrossingEvent *ev = &e->xcrossing;
270 270
271 271
	if((ev->window == root) && !ev->same_screen) {
272 -
		issel = False;
272 +
		activescreen = False;
273 273
		focus(NULL);
274 274
	}
275 275
}
main.c +2 −2
23 23
unsigned int master, nmaster, ntags, numlockmask;
24 24
Atom wmatom[WMLast], netatom[NetLast];
25 25
Bool running = True;
26 -
Bool issel = True;
26 +
Bool activescreen = True;
27 27
Client *clients = NULL;
28 28
Client *sel = NULL;
29 29
Client *stack = NULL;
156 156
	dc.gc = XCreateGC(dpy, root, 0, 0);
157 157
	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
158 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
/*