From c1027567d969a3856796f9ca5026828794b4cb4f Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 13 Oct 2008 07:29:19 +0200 Subject: [PATCH] [hide/unhide] Come back to the old hiding system ; BadMatch else.. --- layout.c | 21 +++++++++++---------- wmfs.c | 26 ++++++++++++++++++++------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/layout.c b/layout.c index 7f032cc..5e9fb1c 100644 --- a/layout.c +++ b/layout.c @@ -96,17 +96,18 @@ maxlayout(void) { Client *c; - for(c = nexttiled(clients); c; c = nexttiled(c->next)) - { - c->tile = False; - c->lmax = True; - c->ox = c->x; c->oy = c->y; - c->ow = c->w; c->oh = c->h; + c = nexttiled(sel);// nexttiled(clients); - moveresize(c, 0, (conf.ttbarheight + ((conf.bartop) ? barheight : 0)), - (mw - (conf.borderheight * 2)), - (mh - (conf.borderheight * 2) - conf.ttbarheight - barheight), False); - } + c->tile = False; + c->lmax = True; + c->ox = c->x; c->oy = c->y; + c->ow = c->w; c->oh = c->h; + + moveresize(c, 0, (conf.ttbarheight + ((conf.bartop) ? barheight : 0)), + (mw - (conf.borderheight * 2)), + (mh - (conf.borderheight * 2) - conf.ttbarheight - barheight), False); + + raiseclient(c); return; } diff --git a/wmfs.c b/wmfs.c index 9ee0a32..35f4702 100644 --- a/wmfs.c +++ b/wmfs.c @@ -116,6 +116,7 @@ client_switch(Bool b) raiseclient(c); } } + arrange(); return; } @@ -193,7 +194,7 @@ focus(Client *c) { setborder(c->win, conf.colors.borderfocus); if(conf.ttbarheight) - setborder(sel->tbar->win, conf.colors.borderfocus); + setborder(c->tbar->win, conf.colors.borderfocus); if(conf.raisefocus) raiseclient(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); @@ -296,7 +297,14 @@ hide(Client *c) if(!c) return; - unmapclient(c); + XMoveWindow(dpy, c->win, c->x, c->y+mh*2); + if(conf.ttbarheight) + { + bar_moveresize(c->tbar, c->x, c->y+mh*2, c->w, c->h); + if(conf.ttbarheight > 5) + XMoveWindow(dpy, c->button, c->x, c->y+mh*2); + } + //unmapclient(c); setwinstate(c->win, IconicState); c->hide = True; @@ -468,8 +476,8 @@ mapclient(Client *c) { if(!c) return; + XMapWindow(dpy, c->win); - XMapSubwindows(dpy, c->win); if(conf.ttbarheight) { XMapWindow(dpy, c->tbar->win); @@ -808,8 +816,14 @@ unhide(Client *c) { if(!c) return; - - mapclient(c); + XMoveWindow(dpy, c->win, c->x, c->y); + if(conf.ttbarheight) + { + bar_moveresize(c->tbar, c->x, c->y - conf.ttbarheight, c->w, conf.ttbarheight); + if(conf.ttbarheight > 5) + XMoveWindow(dpy, c->button, BUTX(c->x, c->w), BUTY(c->y)); + } + //mapclient(c); setwinstate(c->win, NormalState); c->hide = False; @@ -850,6 +864,7 @@ unmapclient(Client *c) { if(!c) return; + XUnmapWindow(dpy, c->win); if(conf.ttbarheight) { @@ -857,7 +872,6 @@ unmapclient(Client *c) if(conf.ttbarheight > 5) XUnmapWindow(dpy, c->button); } - XUnmapSubwindows(dpy, c->win); return; }