From 04de6af22273a3952f6db8331e87326c76efcfda Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sun, 8 Jan 2012 18:52:28 +0200 Subject: destroy invisible windows that request to unmap --- monsterwm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'monsterwm.c') diff --git a/monsterwm.c b/monsterwm.c index 1133f34..a3c4336 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -96,6 +96,7 @@ static void switch_mode(const Arg *arg); static void tile(void); static void togglepanel(); static void update_current(void); +static void unmapnotify(XEvent *e); static client* wintoclient(Window w); static int xerrorstart(); @@ -134,6 +135,7 @@ static void (*events[LASTEvent])(XEvent *e) = { [KeyPress] = keypress, [MapRequest] = maprequest, [PropertyNotify] = propertynotify, + [UnmapNotify] = unmapnotify, }; void addwindow(Window w) { @@ -682,6 +684,11 @@ void togglepanel() { tile(); } +void unmapnotify(XEvent *e) { + client *c = wintoclient(e->xunmap.window); + if (c && e->xunmap.send_event) XDestroyWindow(dis, c->win); +} + void update_current(void) { if (!current) { XDeleteProperty(dis, root, netatoms[NET_ACTIVE]); return; } int border_width = (!head->next || head->next->istransient || mode == MONOCLE) ? 0 : BORDER_WIDTH; -- cgit v1.3.1