[wiki] [sites] [dwm][savefloats] Update thanks to ml || Ivan Tham

From: <git_AT_suckless.org>
Date: Sat, 23 Jul 2016 13:19:38 +0200

commit bb07b5f00ed49c8a96ef81f5afd6194a1c7e8900
Author: Ivan Tham <pickfire_AT_riseup.net>
Date: Sat Jul 23 19:19:12 2016 +0800

    [dwm][savefloats] Update thanks to ml

diff --git a/dwm.suckless.org/patches/dwm-savefloats-20160723-56a31dc.diff b/dwm.suckless.org/patches/dwm-savefloats-20160723-56a31dc.diff
new file mode 100644
index 0000000..7bae6cb
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-savefloats-20160723-56a31dc.diff
_AT_@ -0,0 +1,46 @@
+diff --git a/dwm.c b/dwm.c
+index cfea881..87a23c4 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -107,6 +107,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;
+_AT_@ -1205,10 +1206,10 @@ manage(Window w, XWindowAttributes *wa)
+ c = ecalloc(1, sizeof(Client));
+ c->win = w;
+ /* geometry */
+- c->x = c->oldx = wa->x;
+- c->y = c->oldy = wa->y;
+- c->w = c->oldw = wa->width;
+- c->h = c->oldh = wa->height;
++ c->sfx = c->x = c->oldx = wa->x;
++ c->sfy = c->y = c->oldy = wa->y;
++ c->sfw = c->w = c->oldw = wa->width;
++ c->sfh = c->h = c->oldh = wa->height;
+ c->oldbw = wa->border_width;
+
+ updatetitle(c);
+_AT_@ -1976,8 +1977,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 know float dimentions */
++ resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy,
++ selmon->sel->sfw, selmon->sel->sfh, 0);
++ else {
++ /* save last known float dimentions */
++ 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);
+ }
+
diff --git a/dwm.suckless.org/patches/save_floats.md b/dwm.suckless.org/patches/save_floats.md
index dbd0ec3..a6c5974 100644
--- a/dwm.suckless.org/patches/save_floats.md
+++ b/dwm.suckless.org/patches/save_floats.md
_AT_@ -9,6 +9,7 @@ be restored.
 Patches against different versions of dwm are available at
 [dwm-clean-patches](https://github.com/jceb/dwm-clean-patches).
 
+ * [dwm-savefloats-20160723-56a31dc.diff](dwm-savefloats-20160723-56a31dc.diff) (1452b)
  * [dwm-6.1-save_floats.diff](dwm-6.1-save_floats.diff) (1605b) (20140209)
  * [dwm-10e232f9ace7-save_floats.diff](dwm-10e232f9ace7-save_floats.diff) (1604b) (20120406)
  * [dwm-save_floats-6.0.diff](dwm-save_floats-6.0.diff) (1528b) (20120406)
_AT_@ -16,3 +17,4 @@ Patches against different versions of dwm are available at
 ## Author ##
  * http://nymu.net/patches
  * Updated by Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
+ * Ivan Tham <pickfire_AT_riseup.net> (git port)
Received on Sat Jul 23 2016 - 13:19:38 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 23 2016 - 13:24:16 CEST