forked from mirror/dwm
small changes
This commit is contained in:
parent
edb2660a2e
commit
71b84c2114
4 changed files with 11 additions and 9 deletions
10
client.c
10
client.c
|
@ -85,20 +85,22 @@ focus(Client *c) {
|
||||||
grabbuttons(sel, False);
|
grabbuttons(sel, False);
|
||||||
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
|
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
|
||||||
}
|
}
|
||||||
sel = c;
|
|
||||||
if(!issel)
|
|
||||||
return;
|
|
||||||
if(c) {
|
if(c) {
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
c->snext = stack;
|
c->snext = stack;
|
||||||
stack = c;
|
stack = c;
|
||||||
grabbuttons(c, True);
|
grabbuttons(c, True);
|
||||||
|
}
|
||||||
|
sel = c;
|
||||||
|
drawstatus();
|
||||||
|
if(!activescreen)
|
||||||
|
return;
|
||||||
|
if(sel) {
|
||||||
XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
|
XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
|
||||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
||||||
drawstatus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
|
|
2
dwm.h
2
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 (*handler[LASTEvent])(XEvent *); /* event handler */
|
||||||
extern void (*arrange)(void); /* arrange function, indicates mode */
|
extern void (*arrange)(void); /* arrange function, indicates mode */
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
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 Client *clients, *sel, *stack; /* global client list and stack */
|
||||||
extern Cursor cursor[CurLast];
|
extern Cursor cursor[CurLast];
|
||||||
extern DC dc; /* global draw context */
|
extern DC dc; /* global draw context */
|
||||||
|
|
4
event.c
4
event.c
|
@ -230,7 +230,7 @@ enternotify(XEvent *e) {
|
||||||
if((c = getclient(ev->window)) && isvisible(c))
|
if((c = getclient(ev->window)) && isvisible(c))
|
||||||
focus(c);
|
focus(c);
|
||||||
else if(ev->window == root) {
|
else if(ev->window == root) {
|
||||||
issel = True;
|
activescreen = True;
|
||||||
for(c = stack; c && !isvisible(c); c = c->snext);
|
for(c = stack; c && !isvisible(c); c = c->snext);
|
||||||
focus(c);
|
focus(c);
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ leavenotify(XEvent *e) {
|
||||||
XCrossingEvent *ev = &e->xcrossing;
|
XCrossingEvent *ev = &e->xcrossing;
|
||||||
|
|
||||||
if((ev->window == root) && !ev->same_screen) {
|
if((ev->window == root) && !ev->same_screen) {
|
||||||
issel = False;
|
activescreen = False;
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
main.c
4
main.c
|
@ -23,7 +23,7 @@ int bh, bmw, screen, sx, sy, sw, sh, wax, way, waw, wah;
|
||||||
unsigned int master, nmaster, ntags, numlockmask;
|
unsigned int master, nmaster, ntags, numlockmask;
|
||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
Bool running = True;
|
||||||
Bool issel = True;
|
Bool activescreen = True;
|
||||||
Client *clients = NULL;
|
Client *clients = NULL;
|
||||||
Client *sel = NULL;
|
Client *sel = NULL;
|
||||||
Client *stack = NULL;
|
Client *stack = NULL;
|
||||||
|
@ -156,7 +156,7 @@ setup(void) {
|
||||||
dc.gc = XCreateGC(dpy, root, 0, 0);
|
dc.gc = XCreateGC(dpy, root, 0, 0);
|
||||||
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
/* multihead support */
|
/* multihead support */
|
||||||
issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
activescreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue