# HG changeset patch # User Matthias-Christian Ott # Date 1232051634 -3600 # Node ID 9aa8fdc1ea9b6c87d3b1055f61efeca59b078d91 # Parent add6eb26ebaa4bd39278fe9ca7899d6fa95e3296 save dimensions of floating clients diff --git a/dwm.c b/dwm.c --- a/dwm.c +++ b/dwm.c @@ -83,6 +83,7 @@ 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; @@ -890,6 +891,10 @@ 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); @@ -1112,6 +1117,12 @@ 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); @@ -1347,7 +1358,9 @@ if(ISVISIBLE(c)) { /* show clients top down */ adjustborder(c, borderpx); 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); } @@ -1446,7 +1459,13 @@ 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(); }