summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-06-04 11:50:48 +0200
committerAnselm R. Garbe <arg@suckless.org>2007-06-04 11:50:48 +0200
commit83aa110c6fabbf5f5a14b698a6ca22072cb80629 (patch)
treec79a56f48a11a72a551cf3a9a628362579d11095 /client.c
parentapplied anudots [un]ban repair patch (diff)
downloaddwm-83aa110c6fabbf5f5a14b698a6ca22072cb80629.tar.gz
dwm-83aa110c6fabbf5f5a14b698a6ca22072cb80629.zip
added an creatnotify event handler
Diffstat (limited to 'client.c')
-rw-r--r--client.c62
1 files changed, 39 insertions, 23 deletions
diff --git a/client.c b/client.c
index 06bc9d8..68d10a7 100644
--- a/client.c
+++ b/client.c
@@ -97,6 +97,14 @@ attach(Client *c) {
97} 97}
98 98
99void 99void
100ban(Client *c) {
101 if (c->isbanned)
102 return;
103 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
104 c->isbanned = True;
105}
106
107void
100configure(Client *c) { 108configure(Client *c) {
101 XConfigureEvent ce; 109 XConfigureEvent ce;
102 110
@@ -299,6 +307,37 @@ togglefloating(const char *arg) {
299} 307}
300 308
301void 309void
310unban(Client *c) {
311 if (!c->isbanned)
312 return;
313 XMoveWindow(dpy, c->win, c->x, c->y);
314 c->isbanned = False;
315}
316
317void
318unmanage(Client *c) {
319 XWindowChanges wc;
320
321 wc.border_width = c->oldborder;
322 /* The server grab construct avoids race conditions. */
323 XGrabServer(dpy);
324 XSetErrorHandler(xerrordummy);
325 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
326 detach(c);
327 detachstack(c);
328 if(sel == c)
329 focus(NULL);
330 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
331 setclientstate(c, WithdrawnState);
332 free(c->tags);
333 free(c);
334 XSync(dpy, False);
335 XSetErrorHandler(xerror);
336 XUngrabServer(dpy);
337 lt->arrange();
338}
339
340void
302updatesizehints(Client *c) { 341updatesizehints(Client *c) {
303 long msize; 342 long msize;
304 XSizeHints size; 343 XSizeHints size;
@@ -376,26 +415,3 @@ updatetitle(Client *c) {
376 c->name[sizeof c->name - 1] = '\0'; 415 c->name[sizeof c->name - 1] = '\0';
377 XFree(name.value); 416 XFree(name.value);
378} 417}
379
380void
381unmanage(Client *c) {
382 XWindowChanges wc;
383
384 wc.border_width = c->oldborder;
385 /* The server grab construct avoids race conditions. */
386 XGrabServer(dpy);
387 XSetErrorHandler(xerrordummy);
388 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
389 detach(c);
390 detachstack(c);
391 if(sel == c)
392 focus(NULL);
393 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
394 setclientstate(c, WithdrawnState);
395 free(c->tags);
396 free(c);
397 XSync(dpy, False);
398 XSetErrorHandler(xerror);
399 XUngrabServer(dpy);
400 lt->arrange();
401}