This VM has no display but does have a real GPU -- Vulkan 1.4 through Venus and GL 4.6 through virgl, onto the host's card -- so the only thing missing for a winit window is a compositor. Same trick `emu` uses for the Android emulator: a headless sway, with grim for the picture. It starts its own compositor rather than joining `emu`'s. sway tiles, so adding a window to the one an emulator sits in resizes that emulator, and a peer session's `emu up` could join at any moment. Xwayland is off here because winit speaks Wayland; `emu` forces it on only because the Android emulator's renderer speaks GLX. It waits for the window to be mapped rather than sleeping a fixed time: the first version's fixed sleep captured an all-black screen when sway had started in the same invocation, which is indistinguishable from an app that draws nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 lines
586 B
Plaintext
15 lines
586 B
Plaintext
# The compositor `run-headless.sh` starts, because this machine has no
|
|
# display. Nothing here is meant to be looked at directly; `grim` is.
|
|
#
|
|
# No Xwayland: winit talks Wayland natively, and starting an X server is a
|
|
# second thing to go wrong for no gain. (`emu`'s config forces it because the
|
|
# Android emulator's renderer speaks GLX.)
|
|
xwayland disable
|
|
|
|
# A desktop-shaped output, since this is the desktop half of the port. Larger
|
|
# than the window an example opens, so nothing is scaled or clipped.
|
|
output HEADLESS-1 mode 1920x1200@60Hz
|
|
|
|
default_border none
|
|
focus_follows_mouse no
|