dwm-unfloatvisible-6.2.diff (910B)
1 From a972569532c9d46f79776b0f687ebbbd67a6b69f Mon Sep 17 00:00:00 2001 2 From: Alexander Courtis <alex@courtis.org> 3 Date: Mon, 22 Apr 2019 22:23:12 +1000 4 Subject: [PATCH] unfloat any visible windows which have isfloating set 5 6 optionally takes a layout to also apply 7 8 e.g. 9 { MODKEY|ShiftMask, XK_space, unfloatvisible, {0} }, 10 { MODKEY|ShiftMask, XK_t, unfloatvisible, {.v = &layouts[1]} }, 11 --- 12 unfloat.c | 14 ++++++++++++++ 13 1 file changed, 14 insertions(+) 14 create mode 100644 unfloat.c 15 16 diff --git a/unfloat.c b/unfloat.c 17 new file mode 100644 18 index 0000000..ef84111 19 --- /dev/null 20 +++ b/unfloat.c 21 @@ -0,0 +1,14 @@ 22 +void 23 +unfloatvisible(const Arg *arg) 24 +{ 25 + Client *c; 26 + 27 + for (c = selmon->clients; c; c = c->next) 28 + if (ISVISIBLE(c) && c->isfloating) 29 + c->isfloating = c->isfixed; 30 + 31 + if (arg && arg->v) 32 + setlayout(arg); 33 + else 34 + arrange(selmon); 35 +} 36 -- 37 2.21.0 38