aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-01-08 18:52:28 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-01-08 18:52:28 +0200
commit04de6af22273a3952f6db8331e87326c76efcfda (patch)
tree6b23cd72665d6aba4a123d0507d5079f86fe7820 /monsterwm.c
parent650bcffe0c735d08679801b680909fdf42b4da78 (diff)
destroy invisible windows that request to unmap
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c7
1 files changed, 7 insertions, 0 deletions
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;