diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-06-04 11:50:48 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-06-04 11:50:48 +0200 |
| commit | 83aa110c6fabbf5f5a14b698a6ca22072cb80629 (patch) | |
| tree | c79a56f48a11a72a551cf3a9a628362579d11095 /client.c | |
| parent | applied anudots [un]ban repair patch (diff) | |
| download | dwm-83aa110c6fabbf5f5a14b698a6ca22072cb80629.tar.gz dwm-83aa110c6fabbf5f5a14b698a6ca22072cb80629.zip | |
added an creatnotify event handler
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 62 |
1 files changed, 39 insertions, 23 deletions
| @@ -97,6 +97,14 @@ attach(Client *c) { | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | void | 99 | void |
| 100 | ban(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 | |||
| 107 | void | ||
| 100 | configure(Client *c) { | 108 | configure(Client *c) { |
| 101 | XConfigureEvent ce; | 109 | XConfigureEvent ce; |
| 102 | 110 | ||
| @@ -299,6 +307,37 @@ togglefloating(const char *arg) { | |||
| 299 | } | 307 | } |
| 300 | 308 | ||
| 301 | void | 309 | void |
| 310 | unban(Client *c) { | ||
| 311 | if (!c->isbanned) | ||
| 312 | return; | ||
| 313 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 314 | c->isbanned = False; | ||
| 315 | } | ||
| 316 | |||
| 317 | void | ||
| 318 | unmanage(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 | |||
| 340 | void | ||
| 302 | updatesizehints(Client *c) { | 341 | updatesizehints(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 | |||
| 380 | void | ||
| 381 | unmanage(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 | } | ||
