summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-09-27 17:18:46 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-09-27 17:18:46 +0200
commit6092aa977e9cc87bcf72713af8e7c698ddea4b56 (patch)
treedfdbd6696217e5bb3af23e115168766550713a59
parentremoved an unused var (diff)
downloaddwm-6092aa977e9cc87bcf72713af8e7c698ddea4b56.tar.gz
dwm-6092aa977e9cc87bcf72713af8e7c698ddea4b56.zip
fixing the settags issue, preparing 1.7.1
-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) {
54 GrabModeAsync, GrabModeSync, None, None); 54 GrabModeAsync, GrabModeSync, None, None);
55} 55}
56 56
57static void
58resizetitle(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
70static int 57static int
71xerrordummy(Display *dsply, XErrorEvent *ee) { 58xerrordummy(Display *dsply, XErrorEvent *ee) {
72 return 0; 59 return 0;
@@ -250,11 +237,13 @@ manage(Window w, XWindowAttributes *wa) {
250 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); 237 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
251 238
252 grabbuttons(c, False); 239 grabbuttons(c, False);
240 updatetitle(c);
253 settags(c, getclient(trans)); 241 settags(c, getclient(trans));
254 if(!c->isfloat) 242 if(!c->isfloat)
255 c->isfloat = trans 243 c->isfloat = trans
256 || (c->maxw && c->minw && 244 || (c->maxw && c->minw &&
257 c->maxw == c->minw && c->maxh == c->minh); 245 c->maxw == c->minw && c->maxh == c->minh);
246 resizetitle(c);
258 247
259 if(clients) 248 if(clients)
260 clients->prev = c; 249 clients->prev = c;
@@ -262,7 +251,6 @@ manage(Window w, XWindowAttributes *wa) {
262 c->snext = stack; 251 c->snext = stack;
263 stack = clients = c; 252 stack = clients = c;
264 253
265 updatetitle(c);
266 ban(c); 254 ban(c);
267 XMapWindow(dpy, c->win); 255 XMapWindow(dpy, c->win);
268 XMapWindow(dpy, c->twin); 256 XMapWindow(dpy, c->twin);
@@ -321,6 +309,19 @@ resize(Client *c, Bool sizehints, Corner sticky) {
321} 309}
322 310
323void 311void
312resizetitle(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
324void
324updatesize(Client *c) { 325updatesize(Client *c) {
325 long msize; 326 long msize;
326 XSizeHints size; 327 XSizeHints size;
@@ -382,7 +383,6 @@ updatetitle(Client *c) {
382 } 383 }
383 } 384 }
384 XFree(name.value); 385 XFree(name.value);
385 resizetitle(c);
386} 386}
387 387
388void 388void
diff --git a/config.mk b/config.mk
index 8282cb4..3872652 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# dwm version 1# dwm version
2VERSION = 1.7 2VERSION = 1.7.1
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
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 */
117extern void killclient(Arg *arg); /* kill c nicely */ 117extern void killclient(Arg *arg); /* kill c nicely */
118extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ 118extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
119extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/ 119extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
120extern void resizetitle(Client *c); /* resizes c->twin correctly */
120extern void updatesize(Client *c); /* update the size structs of c */ 121extern void updatesize(Client *c); /* update the size structs of c */
121extern void updatetitle(Client *c); /* update the name of c */ 122extern void updatetitle(Client *c); /* update the name of c */
122extern void unmanage(Client *c); /* destroy c */ 123extern 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) {
316 } 316 }
317 if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { 317 if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
318 updatetitle(c); 318 updatetitle(c);
319 resizetitle(c);
319 drawtitle(c); 320 drawtitle(c);
320 } 321 }
321 } 322 }