X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=client.c;h=eb23452cf7fa4f54f9e5acc046e36d72512a15ff;hb=eb88adcd8a13efbece381440781f2b4577694187;hp=cb5334e7a42df96b3734e39f6d725d8598addc35;hpb=2272df9d3179ec639066614f4d36d18df16ff725;p=dwm.git diff --git a/client.c b/client.c index cb5334e..eb23452 100644 --- a/client.c +++ b/client.c @@ -73,12 +73,14 @@ focus(Client *c) { Client *old = sel; - if (!issel) + if(!issel) return; - if(sel && sel->ismax && sel != c) - togglemax(NULL); - sel = c; - if(old && old != c) { + if(!sel) + sel = c; + else if(sel != c) { + if(sel->ismax) + togglemax(NULL); + sel = c; grabbutton(old, AnyButton, 0); drawtitle(old); } @@ -212,6 +214,7 @@ killclient(Arg *arg) void manage(Window w, XWindowAttributes *wa) { + unsigned int i; Client *c, *tc; Window trans; XSetWindowAttributes twa; @@ -259,7 +262,11 @@ manage(Window w, XWindowAttributes *wa) grabbutton(c, Button2, MODKEY); grabbutton(c, Button3, MODKEY); - settags(c); + if((tc = getclient(trans))) /* inherit tags */ + for(i = 0; i < ntags; i++) + c->tags[i] = tc->tags[i]; + else + settags(c); if(!c->isfloat) c->isfloat = trans || (c->maxw && c->minw &&