diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index e8aeb4f..52fb8e4 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -574,12 +574,19 @@ wl_client_view_unmap(WNativeWindow id) { WLClientToplevel *top = wlc_top_find(id); if (!top || !top->surface) return; - /* Attach NULL + commit to hide the surface. The xdg_surface - * stays configured after the first configure/ack, so subsequent - * commits do not need a new configure event. */ - wl_surface_attach(top->surface, NULL, 0, 0); + /* Replace the popup buffer with a 1x1 transparent buffer. This + * hides the popup visually without triggering an xdg unmap, so + * no configure/ack cycle is needed on reopen. The surface stays + * configured and alive. On reopen, resizeMenu creates a new + * correct-size buffer via wl_client_toplevel_resize. */ + WLClientShmBuffer *old = top->buf; + top->buf = wlclient_create_shm_buffer(top->ctx, 1, 1); + if (!top->buf) { top->buf = old; return; } + if (old) wlclient_destroy_shm_buffer(old); + W_SetViewBacking(top->view->window, top->buf->image); + wl_surface_attach(top->surface, top->buf->wl_buf, 0, 0); + wl_surface_damage_buffer(top->surface, 0, 0, 1, 1); wl_surface_commit(top->surface); - top->configured = 0; top->mapped = 0; if (top->ctx && top->ctx->display) wl_display_flush(top->ctx->display);