talex5 / wayland-proxy-virtwl

Allow guest VMs to open windows on the host
Apache License 2.0
114 stars 12 forks source link

XWayland doesn't honor map/unmap requests #63

Closed puckipedia closed 1 year ago

puckipedia commented 1 year ago

Currently, the code creates a window matching an XWayland buffer as soon as possible, and disregards any unmap requests. However, it seems like for some Qt applications at least, the unmap request happens exactly one second before the corresponding buffer is destroyed. This means that e.g. any menu popups take one second longer to close, which is .. very inconvenient.

I have a partial patch at https://github.com/puckipedia/wayland-proxy-virtwl/commit/4e973fcf60992fcb52326a50619e0791cba7b9a9, but it's incomplete as it requires being able to reliably remap windows after being unmapped.

talex5 commented 1 year ago

Ah, good find! I think you can just remove the buffer to unmap a window:

If wl_surface.attach is sent with a NULL wl_buffer, the following wl_surface.commit will remove the surface content.

This worked for me: https://github.com/talex5/wayland-proxy-virtwl/commit/a508cb93dc92c6e284d32b8a067861c1df0f68c1