Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
fixed focusmon brokeness
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
26ec20b
..
096895c
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-804,13
+804,11
@@
focusmon(const Arg *arg) {
for(i = 0, m = mons; m; m = m->next, i++)
if(i == arg->ui) {
for(i = 0, m = mons; m; m = m->next, i++)
if(i == arg->ui) {
- if(m->stack)
- focus(m->stack);
- else {
- unfocus(selmon->stack);
- selmon = m;
- focus(NULL);
- }
+ if(m == selmon)
+ return;
+ unfocus(selmon->sel);
+ selmon = m;
+ focus(NULL);
drawbars();
break;
}
drawbars();
break;
}
@@
-1502,12
+1500,10
@@
tagmon(const Arg *arg) {
detach(c);
detachstack(c);
c->mon = m;
detach(c);
detachstack(c);
c->mon = m;
- c->tags = m->
seltags
; /* assign tags of target monitor */
+ c->tags = m->
tagset[m->seltags]
; /* assign tags of target monitor */
attach(c);
attachstack(c);
attach(c);
attachstack(c);
- m->sel = c;
- for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
- selmon->sel = c;
+ focus(NULL);
arrange();
break;
}
arrange();
break;
}