Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
applied viewsel.patch
[dwm.git]
/
client.c
diff --git
a/client.c
b/client.c
index
ecfd8f0
..
14edf7c
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-49,11
+49,12
@@
ban(Client *c)
void
focus(Client *c)
{
void
focus(Client *c)
{
- if (!issel)
- return;
Client *old = sel;
Client *old = sel;
- XEvent ev;
+ if (!issel)
+ return;
+ if(sel && sel->ismax)
+ togglemax(NULL);
sel = c;
if(old && old != c)
drawtitle(old);
sel = c;
if(old && old != c)
drawtitle(old);
@@
-69,9
+70,6
@@
focusnext(Arg *arg)
if(!sel)
return;
if(!sel)
return;
- if(sel->ismax)
- togglemax(NULL);
-
if(!(c = getnext(sel->next)))
c = getnext(clients);
if(c) {
if(!(c = getnext(sel->next)))
c = getnext(clients);
if(c) {
@@
-88,9
+86,6
@@
focusprev(Arg *arg)
if(!sel)
return;
if(!sel)
return;
- if(sel->ismax)
- togglemax(NULL);
-
if(!(c = getprev(sel->prev))) {
for(c = clients; c && c->next; c = c->next);
c = getprev(c);
if(!(c = getprev(sel->prev))) {
for(c = clients; c && c->next; c = c->next);
c = getprev(c);
@@
-263,11
+258,13
@@
manage(Window w, XWindowAttributes *wa)
c->maxw == c->minw && c->maxh == c->minh);
settitle(c);
c->maxw == c->minw && c->maxh == c->minh);
settitle(c);
+ if(isvisible(c))
+ sel = c;
+ arrange(NULL);
XMapWindow(dpy, c->win);
XMapWindow(dpy, c->title);
if(isvisible(c))
focus(c);
XMapWindow(dpy, c->win);
XMapWindow(dpy, c->title);
if(isvisible(c))
focus(c);
- arrange(NULL);
}
void
}
void