diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-10 17:34:48 +0200 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-10 17:34:48 +0200 |
commit | 27ad1fe8cf437648549330b038f40637c2ec7e45 (patch) | |
tree | 18a13bf4f3a8f2ca733d25e3e74c9c4f9aab8875 /dwm.c | |
parent | Added cyclelayouts and removed some keybindings [Patch] (diff) | |
download | dwm-27ad1fe8cf437648549330b038f40637c2ec7e45.tar.gz dwm-27ad1fe8cf437648549330b038f40637c2ec7e45.tar.bz2 dwm-27ad1fe8cf437648549330b038f40637c2ec7e45.zip |
Added savefloats patch [Patch]
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c index c241786..52d36d3 100644 --- a/dwm.c +++ b/dwm.c @@ -90,6 +90,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; @@ -1066,6 +1067,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) @@ -1743,8 +1748,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); } |