about summary refs log tree commit diff stats
diff options
context:
space:
mode:
author2014-09-10 13:50:34 -0400
committer2014-09-13 07:56:29 +0200
commit5c560f3784971b1a3bbfc7d18af759778f7779d1 (patch)
tree25f82e27186e9ef13420dcc893d291d08b254ac2
parentb4fed5a100f2fe50cb7caa33e6d58edebe1e7f80 (diff)
downloadtabbed-5c560f3784971b1a3bbfc7d18af759778f7779d1.tar.gz
-rw-r--r--tabbed.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tabbed.c b/tabbed.c
index 6a2264f..68281ac 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -93,6 +93,7 @@ static void clientmessage(const XEvent *e);
 static void configurenotify(const XEvent *e);
 static void configurerequest(const XEvent *e);
 static void createnotify(const XEvent *e);
+static void unmapnotify(const XEvent *e);
 static void destroynotify(const XEvent *e);
 static void die(const char *errstr, ...);
 static void drawbar(void);
@@ -141,6 +142,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = {
 	[ConfigureNotify] = configurenotify,
 	[ConfigureRequest] = configurerequest,
 	[CreateNotify] = createnotify,
+	[UnmapNotify] = unmapnotify,
 	[DestroyNotify] = destroynotify,
 	[Expose] = expose,
 	[FocusIn] = focusin,
@@ -286,6 +288,15 @@ createnotify(const XEvent *e) {
 }
 
 void
+unmapnotify(const XEvent *e) {
+	const XUnmapEvent *ev = &e->xunmap;
+	int c;
+
+	if((c = getclient(ev->window)) > -1)
+		unmanage(c);
+}
+
+void
 destroynotify(const XEvent *e) {
 	const XDestroyWindowEvent *ev = &e->xdestroywindow;
 	int c;