Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6092aa977e | |||
c9cc2b385a | |||
b39d0c521a |
1
.hgtags
1
.hgtags
@ -14,3 +14,4 @@ f5f5cbf016a94b48a8fe9c47f0736e96d166d5d4 1.3
|
||||
3cff9403766bf83a9fc2a0aef230115d68de2a8e 1.4
|
||||
728c9089b079721b43c3347124639a29baa22a97 1.5
|
||||
ad3fa2d185426c51fd5deceae809770363f8d33c 1.6
|
||||
4dbdb61c8b8ce21dee5c7050a6b103855964ed20 1.7
|
||||
|
30
client.c
30
client.c
@ -54,19 +54,6 @@ grabbuttons(Client *c, Bool focused) {
|
||||
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 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
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 @@ manage(Window w, XWindowAttributes *wa) {
|
||||
c->snext = stack;
|
||||
stack = clients = c;
|
||||
|
||||
updatetitle(c);
|
||||
ban(c);
|
||||
XMapWindow(dpy, c->win);
|
||||
XMapWindow(dpy, c->twin);
|
||||
@ -320,6 +308,19 @@ resize(Client *c, Bool sizehints, Corner sticky) {
|
||||
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;
|
||||
@ -382,7 +383,6 @@ updatetitle(Client *c) {
|
||||
}
|
||||
}
|
||||
XFree(name.value);
|
||||
resizetitle(c);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,5 +1,5 @@
|
||||
# dwm version
|
||||
VERSION = 1.7
|
||||
VERSION = 1.7.1
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
|
1
dwm.h
1
dwm.h
@ -117,6 +117,7 @@ extern void gravitate(Client *c, Bool invert); /* gravitate c */
|
||||
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 */
|
||||
|
2
event.c
2
event.c
@ -150,7 +150,6 @@ configurerequest(XEvent *e) {
|
||||
unsigned long newmask;
|
||||
Client *c;
|
||||
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
||||
XEvent synev;
|
||||
XWindowChanges wc;
|
||||
|
||||
if((c = getclient(ev->window))) {
|
||||
@ -317,6 +316,7 @@ propertynotify(XEvent *e) {
|
||||
}
|
||||
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
||||
updatetitle(c);
|
||||
resizetitle(c);
|
||||
drawtitle(c);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user