From: Michael D. Lowis Date: Sat, 14 Mar 2020 20:58:02 +0000 (-0400) Subject: unmap frame windows when the child window unmaps X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=1103389c12bfd9ba8703785c51cdc888fb3c4ead;p=proto%2Fanvil.git unmap frame windows when the child window unmaps --- 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)