2020-05-01 20:54:26 +00:00
|
|
|
From d8a4a789342073568f7e49d48a71c66b0c874aa1 Mon Sep 17 00:00:00 2001
|
Adding attachx, autostart, center, cyclelayouts, fancybar, flextile, focusonnetactive, losefullscreen, pertag, resizecorners, rotatestack, savefloats, single-tagset, statuspadding, switchtag, systray, tagallmon, tagmonfixfs, tagswapmon, togglefullscreen, windowrolerule and zoomswap patches
2020-04-07 16:24:23 +00:00
|
|
|
From: bakkeby <bakkeby@gmail.com>
|
|
|
|
Date: Tue, 7 Apr 2020 11:36:24 +0200
|
|
|
|
Subject: [PATCH] Savefloats, saves size and position of floating windows
|
|
|
|
|
|
|
|
Refer to https://dwm.suckless.org/patches/save_floats/
|
|
|
|
---
|
|
|
|
dwm.c | 17 +++++++++++++++--
|
|
|
|
1 file changed, 15 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/dwm.c b/dwm.c
|
|
|
|
index 4465af1..96b0b26 100644
|
|
|
|
--- a/dwm.c
|
|
|
|
+++ b/dwm.c
|
|
|
|
@@ -88,6 +88,7 @@ struct Client {
|
|
|
|
char name[256];
|
|
|
|
float mina, maxa;
|
|
|
|
int x, y, w, h;
|
|
|
|
+ int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */
|
|
|
|
int oldx, oldy, oldw, oldh;
|
|
|
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
|
|
|
int bw, oldbw;
|
|
|
|
@@ -1056,6 +1057,10 @@ manage(Window w, XWindowAttributes *wa)
|
|
|
|
updatewindowtype(c);
|
|
|
|
updatesizehints(c);
|
|
|
|
updatewmhints(c);
|
|
|
|
+ c->sfx = c->x;
|
|
|
|
+ c->sfy = c->y;
|
|
|
|
+ c->sfw = c->w;
|
|
|
|
+ c->sfh = c->h;
|
|
|
|
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
|
|
|
|
grabbuttons(c, 0);
|
|
|
|
if (!c->isfloating)
|
|
|
|
@@ -1714,8 +1719,16 @@ togglefloating(const Arg *arg)
|
|
|
|
return;
|
|
|
|
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
|
|
|
|
if (selmon->sel->isfloating)
|
|
|
|
- resize(selmon->sel, selmon->sel->x, selmon->sel->y,
|
|
|
|
- selmon->sel->w, selmon->sel->h, 0);
|
|
|
|
+ /* restore last known float dimensions */
|
|
|
|
+ resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy,
|
|
|
|
+ selmon->sel->sfw, selmon->sel->sfh, False);
|
|
|
|
+ else {
|
|
|
|
+ /* save last known float dimensions */
|
|
|
|
+ selmon->sel->sfx = selmon->sel->x;
|
|
|
|
+ selmon->sel->sfy = selmon->sel->y;
|
|
|
|
+ selmon->sel->sfw = selmon->sel->w;
|
|
|
|
+ selmon->sel->sfh = selmon->sel->h;
|
|
|
|
+ }
|
|
|
|
arrange(selmon);
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2020-05-01 20:54:26 +00:00
|
|
|
2.19.1
|
Adding attachx, autostart, center, cyclelayouts, fancybar, flextile, focusonnetactive, losefullscreen, pertag, resizecorners, rotatestack, savefloats, single-tagset, statuspadding, switchtag, systray, tagallmon, tagmonfixfs, tagswapmon, togglefullscreen, windowrolerule and zoomswap patches
2020-04-07 16:24:23 +00:00
|
|
|
|