commit 9cfed5dfc8055d406356aa980dfcc91916bd1f91
parent 82ee2497434f3ab2e1221b991592be3093eea780
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Thu, 16 Feb 2006 23:49:44 +0100
fixed pseudo-zombie frames reported by bogon
Diffstat:
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -150,7 +150,9 @@ focus_client(Client *c, Bool fevent)
void
map_client(Client * c)
{
+ XSelectInput(dpy, c->win, CLIENT_MASK & ~StructureNotifyMask);
XMapRaised(dpy, c->win);
+ XSelectInput(dpy, c->win, CLIENT_MASK);
set_client_state(c, NormalState);
}
@@ -158,15 +160,18 @@ void
unmap_client(Client * c)
{
ungrab_mouse(c->win, AnyModifier, AnyButton);
+ XSelectInput(dpy, c->win, CLIENT_MASK & ~StructureNotifyMask);
XUnmapWindow(dpy, c->win);
+ XSelectInput(dpy, c->win, CLIENT_MASK);
set_client_state(c, WithdrawnState);
}
void
reparent_client(Client *c, Window w, int x, int y)
{
- XReparentWindow(dpy, c->win, w, x, y);
- c->ignore_unmap++;
+ XSelectInput(dpy, c->win, CLIENT_MASK & ~StructureNotifyMask);
+ XReparentWindow(dpy, c->win, w, x, y);
+ XSelectInput(dpy, c->win, CLIENT_MASK);
}
void
@@ -428,6 +433,7 @@ detach_client(Client *c, Bool unmap)
c->rect.x = c->frame.rect.x;
c->rect.y = c->frame.rect.y;
reparent_client(c, root, c->rect.x, c->rect.y);
+ XUnmapWindow(dpy, c->frame.win);
}
}
}
diff --git a/cmd/wm/event.c b/cmd/wm/event.c
@@ -191,6 +191,7 @@ handle_destroynotify(XEvent *e)
XDestroyWindowEvent *ev = &e->xdestroywindow;
Client *c = win_to_client(ev->window);
if(c) {
+ fprintf(stderr, "destroy: %s\n", c->name);
c->destroyed = True;
detach_client(c, False);
}
@@ -282,11 +283,9 @@ handle_unmapnotify(XEvent *e)
XUnmapEvent *ev = &e->xunmap;
Client *c;
if((c = win_to_client(ev->window))) {
- if(!c->ignore_unmap)
- detach_client(c, True);
- else
- c->ignore_unmap--;
- }
+ fprintf(stderr, "unmap %s\n", c->name);
+ detach_client(c, True);
+ }
}
static void handle_clientmessage(XEvent *e)
diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c
@@ -361,7 +361,6 @@ scan_wins()
if(wa.map_state == IsViewable) {
c = alloc_client(wins[i], &wa);
attach_client(c);
- c->ignore_unmap++; /* was viewable already */
}
}
}
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -83,7 +83,6 @@ struct Client {
char name[256];
int proto;
unsigned int border;
- unsigned int ignore_unmap;
Bool destroyed;
Bool maximized;
Area *area;