Hi,
just the usual save floating patch.
Regards,
Matthias-Christian
diff -r ef1026c88059 dwm.c
--- a/dwm.c Tue Sep 09 20:47:01 2008 +0100
+++ b/dwm.c Wed Sep 10 08:18:13 2008 +0200
@@ -85,6 +85,7 @@ struct Client {
char name[256];
float mina, maxa;
int x, y, w, h;
+ int sx, sy, sw, sh;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int bw, oldbw;
unsigned int tags;
@@ -883,6 +884,10 @@ manage(Window w, XWindowAttributes *wa)
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
configure(c); /* propagates border_width, if size doesn't change */
updatesizehints(c);
+ c->sx = c->x;
+ c->sy = c->y;
+ c->sw = c->w;
+ c->sh = c->h;
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
grabbuttons(c, False);
updatetitle(c);
@@ -1096,6 +1101,12 @@ resize(Client *c, int x, int y, int w, i
c->y = wc.y = y;
c->w = wc.width = w;
c->h = wc.height = h;
+ if (!lt[sellt]->arrange || c->isfloating) {
+ c->sx = x;
+ c->sy = y;
+ c->sw = w;
+ c->sh = h;
+ }
wc.border_width = c->bw;
XConfigureWindow(dpy, c->win,
CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
@@ -1374,7 +1385,9 @@ showhide(Client *c) {
return;
if(ISVISIBLE(c)) { /* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y);
- if(!lt[sellt]->arrange || c->isfloating)
+ if(!lt[sellt]->arrange && !c->isfloating)
+ resize(c, c->sx, c->sy, c->sw, c->sh, True);
+ else if (c->isfloating)
resize(c, c->x, c->y, c->w, c->h, True);
showhide(c->snext);
}
@@ -1469,7 +1482,13 @@ togglefloating(const Arg *arg) {
return;
sel->isfloating = !sel->isfloating || sel->isfixed;
if(sel->isfloating)
- resize(sel, sel->x, sel->y, sel->w, sel->h, True);
+ resize(sel, sel->sx, sel->sy, sel->sw, sel->sh, True);
+ else {
+ sel->sx = sel->x;
+ sel->sy = sel->y;
+ sel->sw = sel->w;
+ sel->sh = sel->h;
+ }
arrange();
}