summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-23 18:50:46 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-23 18:50:46 +0200
commit7e597ae204ce94398f8c722e335f20d5a4a30c8a (patch)
tree0a5d9733e2fb01279f6da2abfd2b4a22fc202f19 /client.c
parentapplied tag drawing change to man page (diff)
downloaddwm-7e597ae204ce94398f8c722e335f20d5a4a30c8a.tar.gz
dwm-7e597ae204ce94398f8c722e335f20d5a4a30c8a.zip
updated man page
Diffstat (limited to 'client.c')
-rw-r--r--client.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/client.c b/client.c
index af0190f..c18d88b 100644
--- a/client.c
+++ b/client.c
@@ -28,19 +28,15 @@ resizetitle(Client *c)
28{ 28{
29 int i; 29 int i;
30 30
31 c->tw = 0; 31 c->tw = textw(c->name);
32 for(i = 0; i < ntags; i++)
33 if(c->tags[i])
34 c->tw += textw(tags[i]);
35 c->tw += textw(c->name);
36 if(c->tw > c->w) 32 if(c->tw > c->w)
37 c->tw = c->w + 2; 33 c->tw = c->w + 2;
38 c->tx = c->x + c->w - c->tw + 2; 34 c->tx = c->x + c->w - c->tw + 2;
39 c->ty = c->y; 35 c->ty = c->y;
40 if(isvisible(c)) 36 if(isvisible(c))
41 XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th); 37 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
42 else 38 else
43 XMoveResizeWindow(dpy, c->title, c->tx + 2 * sw, c->ty, c->tw, c->th); 39 XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
44 40
45} 41}
46 42
@@ -65,7 +61,7 @@ void
65ban(Client *c) 61ban(Client *c)
66{ 62{
67 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 63 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
68 XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty); 64 XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
69} 65}
70 66
71void 67void
@@ -106,7 +102,7 @@ getctitle(Window w)
106 Client *c; 102 Client *c;
107 103
108 for(c = clients; c; c = c->next) 104 for(c = clients; c; c = c->next)
109 if(c->title == w) 105 if(c->twin == w)
110 return c; 106 return c;
111 return NULL; 107 return NULL;
112} 108}
@@ -214,7 +210,7 @@ manage(Window w, XWindowAttributes *wa)
214 twa.background_pixmap = ParentRelative; 210 twa.background_pixmap = ParentRelative;
215 twa.event_mask = ExposureMask | EnterWindowMask; 211 twa.event_mask = ExposureMask | EnterWindowMask;
216 212
217 c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, 213 c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
218 0, DefaultDepth(dpy, screen), CopyFromParent, 214 0, DefaultDepth(dpy, screen), CopyFromParent,
219 DefaultVisual(dpy, screen), 215 DefaultVisual(dpy, screen),
220 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); 216 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
@@ -242,7 +238,7 @@ manage(Window w, XWindowAttributes *wa)
242 sel = c; 238 sel = c;
243 arrange(NULL); 239 arrange(NULL);
244 XMapWindow(dpy, c->win); 240 XMapWindow(dpy, c->win);
245 XMapWindow(dpy, c->title); 241 XMapWindow(dpy, c->twin);
246 if(isvisible(c)) 242 if(isvisible(c))
247 focus(c); 243 focus(c);
248} 244}
@@ -329,7 +325,7 @@ void
329settitle(Client *c) 325settitle(Client *c)
330{ 326{
331 char **list = NULL; 327 char **list = NULL;
332 int n; 328 int i, n;
333 XTextProperty name; 329 XTextProperty name;
334 330
335 name.nitems = 0; 331 name.nitems = 0;
@@ -392,7 +388,7 @@ unmanage(Client *c)
392 XSetErrorHandler(xerrordummy); 388 XSetErrorHandler(xerrordummy);
393 389
394 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 390 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
395 XDestroyWindow(dpy, c->title); 391 XDestroyWindow(dpy, c->twin);
396 392
397 if(c->prev) 393 if(c->prev)
398 c->prev->next = c->next; 394 c->prev->next = c->next;