Owner 2905: closing the window to close the window should show a
confirmation. A close the person asks for (the close button, Alt+F4 or the
compositor's close, the taskbar's close, and on macOS the red button, the
menu's or the Dock's Quit, and an uncaptured ⌘Q while capture is on) cut the
VM's power at once: QEMU's handler powers it off with no ACPI.
What the person at the host now sees: while the VM runs, the close first
lets every key and button go in the guest, ends any capture, and asks in
the OS's own dialog over the window: "Turn off the VM?", "The VM turns off
at once, as if its power were cut. Unsaved work in it is lost.", with Turn
Off (destructive) and Cancel, the default for Return and Escape. Turn Off
does what a close did before. Cancel leaves the VM running and nothing held
in the guest. On Linux and Windows it is SDL's message box (zenity or X11's
own on Linux, a task dialog owned by the window on Windows), run on the
windows' UI thread; on macOS an NSAlert sheet on the window, which Quit
shows once, over the key window, for every window. With capture off, ⌘Q is
the guest's, and the menu's Quit and the close button ask.
Nothing asks where nothing is lost: once the host has been told, while the
device is released or QEMU quits, without a close callback, or where the OS
shows no dialog, in which case the close goes ahead as before. There is no
setting and no "don't ask again".
The decision stays in the window crate (close.rs), so the C API keeps its
shape (only the header's words for close change) and QEMU's handler is
unchanged: the close callback now comes after Turn Off. features.md's
Leaving entries carry the new behaviour and its guards.