fix: cover the whole display while a disc loads

The loading surface was invisible. GtkWindow only renders its own CSS
background when the application is not painting the window itself, and
this window was created app-paintable with no draw handler and no child
— so it drew nothing at all. The black area during loading was never it:
it was VLC's own window, tiled by sway into the usable area, which
excludes the strip the dock reserves. That is why the dock and the
wallpaper stayed on screen underneath.

An earlier headless check missed this because that sway had no wallpaper
configured, so an invisible surface and a black one looked identical.
Rechecked with the real wallpaper and the real dock underneath.

The surface now paints, and carries a spinner and "Loading DVD..." on
the same translucent rounded card as the dock. It moves from the top
layer to the overlay layer, because the dock is a top-layer surface and
DVD mode has to cover it rather than depend on which surface sway
created first. Its exclusive zone of -1 keeps sway from moving it out of
the way of the dock's reserved strip.

It goes up before VLC is started rather than alongside it, so no part of
VLC's window is ever seen against the wallpaper, and comes down only
once VLC reports playback on screen. The deadline that takes it down
regardless is now twenty seconds, since an optical drive can be slow,
and a failure to start VLC at all ends the session instead of leaving a
cover with nothing behind it.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
ekklesia
2026-09-04 22:52:21 -05:00
co-authored by Claude Opus 5
parent 4a0ff43253
commit 68b6347c05
3 changed files with 145 additions and 52 deletions
+19 -2
View File
@@ -45,13 +45,30 @@ disc behind it.
`classroom-dvd-session` runs the whole thing:
```
black backdrop layer-shell TOP, covers wallpaper and dock while the
disc loads, hidden once VLC is on screen
loading surface layer-shell OVERLAY, the whole display including the
dock, taken down once playback is on screen
VLC fullscreen, drawn above the top layer by sway
control bar layer-shell OVERLAY, the one layer sway draws above a
fullscreen window
```
### Loading
Pressing DVD covers the entire display immediately — before VLC is even
started — with a black surface carrying a spinner and *Loading DVD…* on
the same translucent rounded card the dock uses. The wallpaper, the dock
and the clock are all gone from the moment the button is pressed.
It is on the **overlay** layer rather than the top layer, because the
dock is a top-layer surface and DVD mode has to cover it. Its exclusive
zone is `-1`, which tells sway not to move it out of the way of the
strip the dock reserves.
It comes down when VLC reports playing or paused, meaning the video
output exists and has taken the display, plus a moment for the handover.
A twenty second deadline takes it down regardless: a cover with nothing
behind it is the one outcome DVD mode must never produce.
VLC is still the backend because its `dvdnav` module is what decodes
disc menus, and nothing else on Debian does that reliably. But nothing
of VLC's own interface is exposed: no menu bar, no panels, no