From 1103389c12bfd9ba8703785c51cdc888fb3c4ead Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sat, 14 Mar 2020 16:58:02 -0400 Subject: [PATCH] unmap frame windows when the child window unmaps --- anvil.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/anvil.c b/anvil.c index aac4234..76b44d7 100644 --- 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) -- 2.54.0