diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-10-05 02:55:53 +0300 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-10-05 21:50:13 +0300 |
| commit | ddaa6fcff5ac1037f32746b7f9db7509a7d9f5b3 (patch) | |
| tree | d9447b9e9a599e31b0b8dc654b8dcfb167c279b6 | |
| parent | 344d3d072b3d3a0ca4fa47359d82ac35666f92fa (diff) | |
when unmapping do not destroy client
| -rw-r--r-- | monsterwm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/monsterwm.c b/monsterwm.c index c22ba9a..a58129e 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -17,6 +17,7 @@ #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) #define BUTTONMASK ButtonPressMask|ButtonReleaseMask #define ISFFT(c) (c->isfull || c->isfloat || c->istrans) +#define ROOTMASK SubstructureRedirectMask|ButtonPressMask|SubstructureNotifyMask|PropertyChangeMask enum { RESIZE, MOVE }; enum { TILE, MONOCLE, BSTACK, GRID, FLOAT, MODES }; @@ -261,8 +262,10 @@ void change_desktop(const Arg *arg) { Desktop *d = &desktops[currdeskidx], *n = &desktops[(currdeskidx = arg->i)]; if (n->curr) XMapWindow(dis, n->curr->win); for (Client *c = n->head; c; c = c->next) XMapWindow(dis, c->win); + XChangeWindowAttributes(dis, root, CWEventMask, &(XSetWindowAttributes){.do_not_propagate_mask = SubstructureNotifyMask}); for (Client *c = d->head; c; c = c->next) if (c != d->curr) XUnmapWindow(dis, c->win); if (d->curr) XUnmapWindow(dis, d->curr->win); + XChangeWindowAttributes(dis, root, CWEventMask, &(XSetWindowAttributes){.event_mask = ROOTMASK}); if (n->head) { tile(n); focus(n->curr, n); } desktopinfo(); } @@ -295,7 +298,9 @@ void client_to_desktop(const Arg *arg) { /* unlink current client from current desktop */ if (d->head == c || !p) d->head = c->next; else p->next = c->next; c->next = NULL; + XChangeWindowAttributes(dis, root, CWEventMask, &(XSetWindowAttributes){.do_not_propagate_mask = SubstructureNotifyMask}); if (XUnmapWindow(dis, c->win)) focus(d->prev, d); + XChangeWindowAttributes(dis, root, CWEventMask, &(XSetWindowAttributes){.event_mask = ROOTMASK}); if (!(c->isfloat || c->istrans) || (d->head && !d->head->next)) tile(d); /* link client to new desktop and make it the current */ @@ -981,8 +986,7 @@ void setup(void) { * if all is good set the generic error handler */ XSetErrorHandler(xerrorstart); /* set masks for reporting events handled by the wm */ - XSelectInput(dis, DefaultRootWindow(dis), SubstructureRedirectMask|ButtonPressMask| - SubstructureNotifyMask|PropertyChangeMask); + XSelectInput(dis, root, ROOTMASK); XSync(dis, False); XSetErrorHandler(xerror); XSync(dis, False); |
