Take screenshots on the Xvfb server, not on the Wayland desktop

winit prefers Wayland when WAYLAND_DISPLAY is set, so `xvfb-run` in a
Wayland session still opened the window on the desktop, where the
compositor chose its size. That looked like the X server ignoring the
requested size. Remove the variable for the screenshot run, and size the
Xvfb screen like the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 01:56:31 +03:00
1 parent 2e4f282732
commit 6d1dd65c17
3 files changed
+24 -14

No files matched your search

+10 -5
View File
@@ -187,14 +187,19 @@ Environment variables (see `src/dev.rs`):
`VOELIN_AUTOSHARE`, `VOELIN_DATA_DIR` as before.
```sh
SLINT_BACKEND=winit-software VOELIN_DATA_DIR=$(mktemp -d) VOELIN_DEMO_UI=1 \
VOELIN_OPEN=settings:appearance VOELIN_WINDOW_SIZE=1440x960 \
scripts/shots.sh shot.png settings:appearance 1440x960
# which runs, headless:
env -u WAYLAND_DISPLAY SLINT_BACKEND=winit-software VOELIN_DATA_DIR=$(mktemp -d) \
VOELIN_DEMO_UI=1 VOELIN_OPEN=settings:appearance VOELIN_WINDOW_SIZE=1440x960 \
VOELIN_SCREENSHOT=shot.png VOELIN_SCREENSHOT_DELAY=4 \
xvfb-run -a -s "-screen 0 1600x1100x24" target/debug/voelin
xvfb-run -a -s "-screen 0 1440x960x24" target/debug/voelin
```
The pictures in `docs/screenshots/` were made this way (reduced to 256
colours with `convert -colors 256 PNG8:`).
Remove `WAYLAND_DISPLAY` as above in a Wayland session: winit prefers
Wayland, so the window would open on the desktop instead of on the Xvfb
server (and take whatever size the compositor gives it). The pictures in
`docs/screenshots/` were made this way (reduced to 256 colours with
`convert -colors 256 PNG8:`).
| Desktop | |
|---|---|