feat: add dispatch toggle_all_floating

This commit is contained in:
DreamMaoMao 2026-03-19 07:56:29 +08:00
parent 6f860e8364
commit 21b30f179d
5 changed files with 22 additions and 1 deletions

View file

@ -70,3 +70,4 @@ int32_t disable_monitor(const Arg *arg);
int32_t enable_monitor(const Arg *arg);
int32_t toggle_monitor(const Arg *arg);
int32_t scroller_stack(const Arg *arg);
int32_t toggle_all_floating(const Arg *arg);

View file

@ -1867,3 +1867,19 @@ int32_t scroller_stack(const Arg *arg) {
arrange(selmon, false, false);
return 0;
}
int32_t toggle_all_floating(const Arg *arg) {
if (!selmon || !selmon->sel)
return 0;
Client *c = NULL;
bool should_floating = !selmon->sel->isfloating;
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, selmon)) {
if (c->isfloating != should_floating) {
setfloating(c, should_floating);
}
}
}
return 0;
}