fixing the settags issue, preparing 1.7.1
6092aa97
4 file(s) · +18 −16
| 54 | 54 | GrabModeAsync, GrabModeSync, None, None); |
|
| 55 | 55 | } |
|
| 56 | 56 | ||
| 57 | - | static void |
|
| 58 | - | resizetitle(Client *c) { |
|
| 59 | - | c->tw = textw(c->name); |
|
| 60 | - | if(c->tw > c->w) |
|
| 61 | - | c->tw = c->w + 2; |
|
| 62 | - | c->tx = c->x + c->w - c->tw + 2; |
|
| 63 | - | c->ty = c->y; |
|
| 64 | - | if(isvisible(c)) |
|
| 65 | - | XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); |
|
| 66 | - | else |
|
| 67 | - | XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); |
|
| 68 | - | } |
|
| 69 | - | ||
| 70 | 57 | static int |
|
| 71 | 58 | xerrordummy(Display *dsply, XErrorEvent *ee) { |
|
| 72 | 59 | return 0; |
|
| 250 | 237 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); |
|
| 251 | 238 | ||
| 252 | 239 | grabbuttons(c, False); |
|
| 240 | + | updatetitle(c); |
|
| 253 | 241 | settags(c, getclient(trans)); |
|
| 254 | 242 | if(!c->isfloat) |
|
| 255 | 243 | c->isfloat = trans |
|
| 256 | 244 | || (c->maxw && c->minw && |
|
| 257 | 245 | c->maxw == c->minw && c->maxh == c->minh); |
|
| 246 | + | resizetitle(c); |
|
| 258 | 247 | ||
| 259 | 248 | if(clients) |
|
| 260 | 249 | clients->prev = c; |
|
| 262 | 251 | c->snext = stack; |
|
| 263 | 252 | stack = clients = c; |
|
| 264 | 253 | ||
| 265 | - | updatetitle(c); |
|
| 266 | 254 | ban(c); |
|
| 267 | 255 | XMapWindow(dpy, c->win); |
|
| 268 | 256 | XMapWindow(dpy, c->twin); |
|
| 321 | 309 | } |
|
| 322 | 310 | ||
| 323 | 311 | void |
|
| 312 | + | resizetitle(Client *c) { |
|
| 313 | + | c->tw = textw(c->name); |
|
| 314 | + | if(c->tw > c->w) |
|
| 315 | + | c->tw = c->w + 2; |
|
| 316 | + | c->tx = c->x + c->w - c->tw + 2; |
|
| 317 | + | c->ty = c->y; |
|
| 318 | + | if(isvisible(c)) |
|
| 319 | + | XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); |
|
| 320 | + | else |
|
| 321 | + | XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); |
|
| 322 | + | } |
|
| 323 | + | ||
| 324 | + | void |
|
| 324 | 325 | updatesize(Client *c) { |
|
| 325 | 326 | long msize; |
|
| 326 | 327 | XSizeHints size; |
|
| 382 | 383 | } |
|
| 383 | 384 | } |
|
| 384 | 385 | XFree(name.value); |
|
| 385 | - | resizetitle(c); |
|
| 386 | 386 | } |
|
| 387 | 387 | ||
| 388 | 388 | void |
|
| 1 | 1 | # dwm version |
|
| 2 | - | VERSION = 1.7 |
|
| 2 | + | VERSION = 1.7.1 |
|
| 3 | 3 | ||
| 4 | 4 | # Customize below to fit your system |
|
| 5 | 5 |
| 117 | 117 | extern void killclient(Arg *arg); /* kill c nicely */ |
|
| 118 | 118 | extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ |
|
| 119 | 119 | extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/ |
|
| 120 | + | extern void resizetitle(Client *c); /* resizes c->twin correctly */ |
|
| 120 | 121 | extern void updatesize(Client *c); /* update the size structs of c */ |
|
| 121 | 122 | extern void updatetitle(Client *c); /* update the name of c */ |
|
| 122 | 123 | extern void unmanage(Client *c); /* destroy c */ |
| 316 | 316 | } |
|
| 317 | 317 | if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { |
|
| 318 | 318 | updatetitle(c); |
|
| 319 | + | resizetitle(c); |
|
| 319 | 320 | drawtitle(c); |
|
| 320 | 321 | } |
|
| 321 | 322 | } |