talex5 / wayland-proxy-virtwl

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

virtio-gpu: ensure connection ends promptly #73

Closed talex5 closed 9 months ago

talex5 commented 10 months ago

When a client disconnects, ocaml-wayland tries to shut down the host connection. However, shutdown isn't supported for virtio-gpu hosts. This can cause stale windows to remain on the screen for a bit, e.g.

  1. Run a Wayland client.
  2. Kill it with CTRL-C.
  3. We can't shut down the host socket and try to close it instead. Since a read is currently in progress, Eio delays closing the underlying FD.
  4. Moving the pointer over the application's window causes the compositor to send an event. This causes the read to complete, which allows the FD to be closed, causing the window to disappear at last.

Now, when a client finishes we cancel the switch, forcing the read to terminate immediately.