about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c30
-rw-r--r--config.mk2
-rw-r--r--dwm.h1
-rw-r--r--event.c1
4 files changed, 18 insertions, 16 deletions
diff --git a/client.c b/client.c
index 87c2f76..6b0322e 100644
--- a/client.c
+++ b/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);
@@ -321,6 +309,19 @@ resize(Client *c, Bool sizehints, Corner sticky) {
 }
 
 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 @@ updatetitle(Client *c) {
 		}
 	}
 	XFree(name.value);
-	resizetitle(c);
 }
 
 void
diff --git a/config.mk b/config.mk
index 8282cb4..3872652 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 1.7
+VERSION = 1.7.1
 
 # Customize below to fit your system
 
diff --git a/dwm.h b/dwm.h
index 269c78e..85c85a3 100644
--- a/dwm.h
+++ b/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 */
diff --git a/event.c b/event.c
index 76f3602..2df3821 100644
--- a/event.c
+++ b/event.c
@@ -316,6 +316,7 @@ propertynotify(XEvent *e) {
 		}
 		if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
 			updatetitle(c);
+			resizetitle(c);
 			drawtitle(c);
 		}
 	}
72f4e7d'>4bea11d6 ^
41df56be ^

185857d8 ^



41df56be ^






8eecaa8a ^
41df56be ^






f93725f5 ^



41df56be ^

7c9e8e28 ^
41df56be ^









185857d8 ^

8eecaa8a ^
41df56be ^















f93725f5 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143