X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=33b3c564118d1ee61b4fb9bbda80653043de7434;hb=28aba061ec2a6fa7923ea00b43e1335a27a73c06;hp=956b13f021c79c2ede8bba8fec983327b2034129;hpb=ca65478c8968434c78aacf4a102ccbbe4a66ad9e;p=dwm.git diff --git a/client.c b/client.c index 956b13f..33b3c56 100644 --- a/client.c +++ b/client.c @@ -84,7 +84,7 @@ void focus(Client *c) { Client *old; - if(!issel) + if(!issel || (c && !isvisible(c))) return; if(!sel) sel = c; @@ -281,6 +281,16 @@ resize(Client *c, Bool sizehints, Corner sticky) { if(sticky == BotLeft || sticky == BotRight) c->y = bottom - c->h; + /* offscreen appearance fixes */ + if(c->x + c->w < 0) + c->x = 0; + if(c->y + c->h < bh) + c->y = bh; + if(c->x > sw) + c->x = sw - c->w; + if(c->y > sh) + c->y = sh - c->h; + resizetitle(c); wc.x = c->x; wc.y = c->y;