mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-26 07:58:16 -04:00
feat: add dispatch toggle_all_floating
This commit is contained in:
parent
6f860e8364
commit
21b30f179d
5 changed files with 22 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue