mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Use a similarly named check as sticky for hidden check in a group.
This commit is contained in:
parent
7eef4eb63d
commit
736d973f46
2
calmwm.h
2
calmwm.h
@ -406,9 +406,9 @@ void client_wm_hints(struct client_ctx *);
|
|||||||
void group_alltoggle(struct screen_ctx *);
|
void group_alltoggle(struct screen_ctx *);
|
||||||
void group_autogroup(struct client_ctx *);
|
void group_autogroup(struct client_ctx *);
|
||||||
void group_cycle(struct screen_ctx *, int);
|
void group_cycle(struct screen_ctx *, int);
|
||||||
int group_hidden_state(struct group_ctx *);
|
|
||||||
void group_hide(struct group_ctx *);
|
void group_hide(struct group_ctx *);
|
||||||
void group_hidetoggle(struct screen_ctx *, int);
|
void group_hidetoggle(struct screen_ctx *, int);
|
||||||
|
int group_holds_only_hidden(struct group_ctx *);
|
||||||
int group_holds_only_sticky(struct group_ctx *);
|
int group_holds_only_sticky(struct group_ctx *);
|
||||||
void group_init(struct screen_ctx *);
|
void group_init(struct screen_ctx *);
|
||||||
void group_movetogroup(struct client_ctx *, int);
|
void group_movetogroup(struct client_ctx *, int);
|
||||||
|
14
group.c
14
group.c
@ -170,7 +170,7 @@ group_movetogroup(struct client_ctx *cc, int idx)
|
|||||||
|
|
||||||
if (cc->group == gc)
|
if (cc->group == gc)
|
||||||
return;
|
return;
|
||||||
if (group_hidden_state(gc))
|
if (group_holds_only_hidden(gc))
|
||||||
client_hide(cc);
|
client_hide(cc);
|
||||||
group_assign(gc, cc);
|
group_assign(gc, cc);
|
||||||
}
|
}
|
||||||
@ -207,7 +207,6 @@ group_holds_only_sticky(struct group_ctx *gc)
|
|||||||
{
|
{
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
/* Check if all clients in the group are 'sticky'. */
|
|
||||||
TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
|
TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
|
||||||
if (!(cc->flags & CLIENT_STICKY))
|
if (!(cc->flags & CLIENT_STICKY))
|
||||||
return(0);
|
return(0);
|
||||||
@ -215,11 +214,8 @@ group_holds_only_sticky(struct group_ctx *gc)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* If all clients in a group are hidden, then the group state is hidden.
|
|
||||||
*/
|
|
||||||
int
|
int
|
||||||
group_hidden_state(struct group_ctx *gc)
|
group_holds_only_hidden(struct group_ctx *gc)
|
||||||
{
|
{
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
int hidden = 0, same = 0;
|
int hidden = 0, same = 0;
|
||||||
@ -250,7 +246,7 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (group_hidden_state(gc))
|
if (group_holds_only_hidden(gc))
|
||||||
group_show(gc);
|
group_show(gc);
|
||||||
else {
|
else {
|
||||||
group_hide(gc);
|
group_hide(gc);
|
||||||
@ -298,7 +294,7 @@ group_cycle(struct screen_ctx *sc, int flags)
|
|||||||
|
|
||||||
if (!group_holds_only_sticky(gc) && showgroup == NULL)
|
if (!group_holds_only_sticky(gc) && showgroup == NULL)
|
||||||
showgroup = gc;
|
showgroup = gc;
|
||||||
else if (!group_hidden_state(gc))
|
else if (!group_holds_only_hidden(gc))
|
||||||
group_hide(gc);
|
group_hide(gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +303,7 @@ group_cycle(struct screen_ctx *sc, int flags)
|
|||||||
|
|
||||||
group_hide(sc->group_active);
|
group_hide(sc->group_active);
|
||||||
|
|
||||||
if (group_hidden_state(showgroup))
|
if (group_holds_only_hidden(showgroup))
|
||||||
group_show(showgroup);
|
group_show(showgroup);
|
||||||
else
|
else
|
||||||
group_setactive(sc, showgroup->num);
|
group_setactive(sc, showgroup->num);
|
||||||
|
@ -191,7 +191,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg)
|
|||||||
if (group_holds_only_sticky(gc))
|
if (group_holds_only_sticky(gc))
|
||||||
continue;
|
continue;
|
||||||
menuq_add(&menuq, gc,
|
menuq_add(&menuq, gc,
|
||||||
group_hidden_state(gc) ? "%d: [%s]" : "%d: %s",
|
group_holds_only_hidden(gc) ? "%d: [%s]" : "%d: %s",
|
||||||
gc->num, gc->name);
|
gc->num, gc->name);
|
||||||
}
|
}
|
||||||
if (TAILQ_EMPTY(&menuq))
|
if (TAILQ_EMPTY(&menuq))
|
||||||
@ -200,7 +200,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg)
|
|||||||
if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
|
if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
|
||||||
NULL, NULL)) != NULL) {
|
NULL, NULL)) != NULL) {
|
||||||
gc = (struct group_ctx *)mi->ctx;
|
gc = (struct group_ctx *)mi->ctx;
|
||||||
(group_hidden_state(gc)) ?
|
(group_holds_only_hidden(gc)) ?
|
||||||
group_show(gc) : group_hide(gc);
|
group_show(gc) : group_hide(gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user