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;
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;
c->snext = stack;
stack = clients = c;
- updatetitle(c);
ban(c);
XMapWindow(dpy, c->win);
XMapWindow(dpy, c->twin);
XSync(dpy, False);
}
+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;
}
}
XFree(name.value);
- resizetitle(c);
}
void
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 */