# HG changeset patch # User Anselm R. Garbe # Date 1159370326 -7200 # Node ID d5ad819f2a66a40fa75dd2e44429f3bfc884d07b # Parent 2ca011c563858277ac8326c8e41621652fd34fa4 fixing the settags issue, preparing 1.7.1 diff -r 2ca011c56385 -r d5ad819f2a66 client.c --- a/client.c Tue Sep 26 17:42:14 2006 +0200 +++ b/client.c Wed Sep 27 17:18:46 2006 +0200 @@ -54,19 +54,6 @@ GrabModeAsync, GrabModeSync, None, None); } -static void -resizetitle(Client *c) { - c->tw = textw(c->name); - if(c->tw > c->w) - c->tw = c->w + 2; - c->tx = c->x + c->w - c->tw + 2; - c->ty = c->y; - if(isvisible(c)) - XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); - else - XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); -} - static int xerrordummy(Display *dsply, XErrorEvent *ee) { return 0; @@ -250,11 +237,13 @@ CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); grabbuttons(c, False); + updatetitle(c); settags(c, getclient(trans)); if(!c->isfloat) c->isfloat = trans || (c->maxw && c->minw && c->maxw == c->minw && c->maxh == c->minh); + resizetitle(c); if(clients) clients->prev = c; @@ -262,7 +251,6 @@ c->snext = stack; stack = clients = c; - updatetitle(c); ban(c); XMapWindow(dpy, c->win); XMapWindow(dpy, c->twin); @@ -321,6 +309,19 @@ } void +resizetitle(Client *c) { + c->tw = textw(c->name); + if(c->tw > c->w) + c->tw = c->w + 2; + c->tx = c->x + c->w - c->tw + 2; + c->ty = c->y; + if(isvisible(c)) + XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); + else + XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); +} + +void updatesize(Client *c) { long msize; XSizeHints size; @@ -382,7 +383,6 @@ } } XFree(name.value); - resizetitle(c); } void diff -r 2ca011c56385 -r d5ad819f2a66 config.mk --- a/config.mk Tue Sep 26 17:42:14 2006 +0200 +++ b/config.mk Wed Sep 27 17:18:46 2006 +0200 @@ -1,5 +1,5 @@ # dwm version -VERSION = 1.7 +VERSION = 1.7.1 # Customize below to fit your system diff -r 2ca011c56385 -r d5ad819f2a66 dwm.h --- a/dwm.h Tue Sep 26 17:42:14 2006 +0200 +++ b/dwm.h Wed Sep 27 17:18:46 2006 +0200 @@ -117,6 +117,7 @@ extern void killclient(Arg *arg); /* kill c nicely */ extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/ +extern void resizetitle(Client *c); /* resizes c->twin correctly */ extern void updatesize(Client *c); /* update the size structs of c */ extern void updatetitle(Client *c); /* update the name of c */ extern void unmanage(Client *c); /* destroy c */ diff -r 2ca011c56385 -r d5ad819f2a66 event.c --- a/event.c Tue Sep 26 17:42:14 2006 +0200 +++ b/event.c Wed Sep 27 17:18:46 2006 +0200 @@ -316,6 +316,7 @@ } if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { updatetitle(c); + resizetitle(c); drawtitle(c); } }