]> git.mdlowis.com Git - proto/anvil.git/commitdiff
unmap frame windows when the child window unmaps
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 14 Mar 2020 20:58:02 +0000 (16:58 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 14 Mar 2020 20:58:02 +0000 (16:58 -0400)
anvil.c

diff --git a/anvil.c b/anvil.c
index aac42347538a86780b6bc92843b5202666343e0f..76b44d732a2cd6e3050fcc6adb0e53059599d0d6 100644 (file)
--- a/anvil.c
+++ b/anvil.c
@@ -32,7 +32,8 @@ static void xbtnpress(XEvent* e)
     Client* c = client_get(e->xbutton.window);
     if (c && (ev->window == c->frame))
     {
-        if (ev->button == Button1) {
+        if (ev->button == Button1)
+        {
            client_raise(c);
             X.start_x = ev->x_root;
             X.start_y = ev->y_root;
@@ -41,9 +42,13 @@ static void xbtnpress(XEvent* e)
                 X.reshaping = 1;
                 warp_mouse(c);
             }
-        } else if (ev->button == Button2) {
+        }
+        else if (ev->button == Button2)
+        {
             client_close(c);
-        } else if (ev->button == Button3) {
+        }
+        else if (ev->button == Button3)
+        {
             client_lower(c);
         }
     }
@@ -119,7 +124,12 @@ static void xmaprequest(XEvent* e)
 
 static void xunmapnotify(XEvent* e)
 {
-    (void)e;
+    XUnmapEvent* ev = &(e->xunmap);
+    Client* c = client_get(ev->window);
+    if (c && c->win == ev->window)
+    {
+        XUnmapWindow(X.disp, c->frame);
+    }
 }
 
 static void xdestroynotify(XEvent* e)