diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-01-23 12:29:17 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-01-23 12:29:17 +0100 |
| commit | 71b84c21149adb7adff6140a1f471c4a294edd4b (patch) | |
| tree | 05ebdbb11aedafabec4e632b3962522658ffb570 | |
| parent | removed a blank line (diff) | |
| download | dwm-71b84c21149adb7adff6140a1f471c4a294edd4b.tar.gz dwm-71b84c21149adb7adff6140a1f471c4a294edd4b.zip | |
small changes
Diffstat (limited to '')
| -rw-r--r-- | client.c | 10 | ||||
| -rw-r--r-- | dwm.h | 2 | ||||
| -rw-r--r-- | event.c | 4 | ||||
| -rw-r--r-- | main.c | 4 |
4 files changed, 11 insertions, 9 deletions
| @@ -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 | ||
| 104 | Client * | 106 | Client * |
| @@ -93,7 +93,7 @@ extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */ | |||
| 93 | extern void (*handler[LASTEvent])(XEvent *); /* event handler */ | 93 | extern void (*handler[LASTEvent])(XEvent *); /* event handler */ |
| 94 | extern void (*arrange)(void); /* arrange function, indicates mode */ | 94 | extern void (*arrange)(void); /* arrange function, indicates mode */ |
| 95 | extern Atom wmatom[WMLast], netatom[NetLast]; | 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 | extern Client *clients, *sel, *stack; /* global client list and stack */ | 97 | extern Client *clients, *sel, *stack; /* global client list and stack */ |
| 98 | extern Cursor cursor[CurLast]; | 98 | extern Cursor cursor[CurLast]; |
| 99 | extern DC dc; /* global draw context */ | 99 | extern DC dc; /* global draw context */ |
| @@ -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 | } |
| @@ -23,7 +23,7 @@ int bh, bmw, screen, sx, sy, sw, sh, wax, way, waw, wah; | |||
| 23 | unsigned int master, nmaster, ntags, numlockmask; | 23 | unsigned int master, nmaster, ntags, numlockmask; |
| 24 | Atom wmatom[WMLast], netatom[NetLast]; | 24 | Atom wmatom[WMLast], netatom[NetLast]; |
| 25 | Bool running = True; | 25 | Bool running = True; |
| 26 | Bool issel = True; | 26 | Bool activescreen = True; |
| 27 | Client *clients = NULL; | 27 | Client *clients = NULL; |
| 28 | Client *sel = NULL; | 28 | Client *sel = NULL; |
| 29 | Client *stack = NULL; | 29 | Client *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 | /* |
