mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Ensure we don't action on the last group when the requested one is not found.
This commit is contained in:
parent
8cd6d1154c
commit
880b5cda3f
36
group.c
36
group.c
@ -160,15 +160,14 @@ group_movetogroup(struct client_ctx *cc, int idx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
||||||
if (gc->num == idx)
|
if (gc->num == idx) {
|
||||||
break;
|
if (cc->gc == gc)
|
||||||
|
return;
|
||||||
|
if (gc->num != 0 && group_holds_only_hidden(gc))
|
||||||
|
client_hide(cc);
|
||||||
|
group_assign(gc, cc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->gc == gc)
|
|
||||||
return;
|
|
||||||
if (gc->num != 0 && group_holds_only_hidden(gc))
|
|
||||||
client_hide(cc);
|
|
||||||
group_assign(gc, cc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -221,17 +220,16 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
||||||
if (gc->num == idx)
|
if (gc->num == idx) {
|
||||||
break;
|
if (group_holds_only_hidden(gc))
|
||||||
}
|
group_show(gc);
|
||||||
|
else {
|
||||||
if (group_holds_only_hidden(gc))
|
group_hide(gc);
|
||||||
group_show(gc);
|
/* make clients stick to empty group */
|
||||||
else {
|
if (TAILQ_EMPTY(&gc->clientq))
|
||||||
group_hide(gc);
|
group_setactive(gc);
|
||||||
/* make clients stick to empty group */
|
}
|
||||||
if (TAILQ_EMPTY(&gc->clientq))
|
}
|
||||||
group_setactive(gc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user