feat: make DVD playback a classroom surface, not a media player

Pressing DVD now enters DVD mode rather than opening VLC. VLC is still
the backend, because its dvdnav module is what decodes disc menus and
nothing else on Debian does that reliably, but nothing a person can see
or press belongs to it any more.

classroom-dvd-session owns the whole thing. It puts a full-screen black
layer-shell surface up the moment the button is pressed, starts VLC
behind it, and drops it once playback is actually on screen — so the
harsh cut from wallpaper to VLC's black window is gone, and no partial
VLC window or reserved dock strip is ever visible. A deadline drops the
surface regardless, because DVD mode must never leave a black screen
with nothing behind it.

The controls are a classroom bar on the overlay layer, the one layer
sway draws above a fullscreen window. It slides up when the pointer
reaches the bottom of the screen and hides again shortly after it
leaves. It is drawn from the dock's own stylesheet at the room's UI
scale, so it is the same surface, the same radius and the same white
icons. While hidden it only accepts the pointer in a thin strip along
the bottom edge, so a click on a disc menu goes to the disc.

The bar reaches VLC through an HTTP interface on loopback behind a
password generated per session, sending hotkey *actions* by name. That
is what makes the next part possible.

All 108 hotkeys VLC 3.0.23 defines are unset, then Space, Esc and the
arrow keys plus Enter are bound. Crop, aspect ratio, subtitles, audio
tracks and deinterlacing are no longer reachable by pressing a key at
random, and the arrow keys no longer change VLC's volume — the
television owns volume, and CEC will own it properly later.

Esc quits instead of leaving fullscreen. There is nothing to leave, and
leaving it was what stranded people on a black VLC window. Close, Eject
and Esc all ask VLC to quit and escalate to SIGTERM then SIGKILL if it
does not; when VLC exits by any route, including a crash, the session
ends and the classroom desktop comes back.

Verified against VLC 3.0.23 on Trixie: every argument accepted, every
control action accepted over the control interface, a wrong password
refused, and quit exiting cleanly. The surfaces were rendered under a
headless sway and screenshotted to check the bar against the dock.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
ekklesia
2026-09-04 22:33:53 -05:00
co-authored by Claude Opus 5
parent 3e69f3f05c
commit f8ddfbe345
17 changed files with 961 additions and 88 deletions
+68 -38
View File
@@ -36,54 +36,84 @@ Discs never play on their own; playback always needs a button press.
The first poll after login only records what is already in the drive, so
a disc left in over the week does not announce itself at every boot.
## Playback
## Playback: DVD mode
Playback is VLC, chosen over mpv because mpv dropped DVD menu support.
VLC's `dvdnav` module is what provides the disc menus, and `dvd://`
selects it.
Pressing DVD does not open a media player. It enters **DVD mode**: a
full-screen playback surface the classroom owns, with VLC decoding the
disc behind it.
`classroom-dvd toggle` hands the disc to VLC through `classroom-window`,
so the DVD player behaves like any other classroom application: the DVD
button focuses it, minimises it, and restores it. `Super+M` minimises it
too. VLC starts fullscreen; `Esc` leaves fullscreen.
`classroom-dvd-session` runs the whole thing:
## How VLC is made to fit the classroom
```
black backdrop layer-shell TOP, covers wallpaper and dock while the
disc loads, hidden once VLC 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
```
Stock VLC looks like a desktop media player, which is wrong for a room
where the TV is the whole interface. It is dressed down with documented
VLC 3.x options — no skin is involved, because skins replace the
interface wholesale and take DVD menu input with them:
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
fullscreen controller, no cone, and no sway title bar.
| Option | Why |
### The control bar
Move the mouse to the bottom of the screen and a bar slides up. It is
the same dark translucent rounded surface as the dock, drawn from the
same stylesheet at the same UI scale, so DVD mode feels like the same
room. It hides again a second after the pointer leaves it, or after four
seconds without movement.
| Control | Does |
| --- | --- |
| `--fullscreen` | The disc opens straight onto the TV |
| `--qt-minimal-view` | No menu bar or extended panels |
| `--qt-dark-palette` | Dark window instead of the default light grey |
| `--no-qt-bgcone` | No orange cone, no album-art panel |
| `--no-qt-system-tray` | Not a background desktop application |
| `--no-qt-name-in-title` | Nothing in the title bar to read |
| `--no-qt-video-autoresize` | The window does not jump to the video size |
| `--qt-notification=0` | No now-playing popups |
| `--qt-continue=0` | Never asks to resume where it left off |
| `--no-qt-recentplay` | No history of the discs a classroom has played |
| `--no-qt-privacy-ask` | No first-run privacy dialog |
| `--no-video-title-show` | No title banner over the video |
| ⏮ | Previous chapter |
| ▶ / ⏸ | Play or pause, showing which one it will do |
| ⏭ | Next chapter |
| ☰ | Back to the disc menu |
| ⏏ | Ejects the disc and leaves DVD mode |
| ✕ | Leaves DVD mode |
sway also draws no border on the VLC window
(`for_window [class="(?i)vlc"] border none`), so there is no title bar
above the video either.
While the bar is hidden it only accepts the pointer in a thin strip
along the very bottom edge, so a click anywhere else goes to the disc
menu rather than to an invisible bar.
The auto-hiding fullscreen controller is deliberately **kept**. It is
the only way to pause or change chapter with a mouse, it is not
persistent chrome, and a volunteer with a wireless mouse needs it.
The bar reaches VLC over an HTTP control interface on the loopback
address, behind a password generated for that session alone. Commands
are sent as VLC hotkey **actions** by name, which is why they keep
working even though every key has been unbound.
`--intf dummy` would give an even barer window, but the dummy interface
takes the keyboard and mouse handling that DVD menu navigation depends
on, so it is not an option here.
### The keyboard
Note that `--no-qt-updates-notif`, which earlier classroom builds
passed, is not an option in Debian's VLC at all — it made VLC exit
before it started.
All 108 hotkeys VLC 3.0.23 defines are unset, then these are bound:
| Key | Does |
| --- | --- |
| Space | Play / pause |
| Esc | Leaves DVD mode |
| Arrow keys | Move around a disc menu |
| Enter | Choose the highlighted menu item |
Nothing else responds. A volunteer cannot land on crop, aspect ratio,
subtitle tracks, audio tracks or deinterlacing by pressing a key at
random, and **the arrow keys no longer change VLC's volume** — the
television owns volume.
Esc quits rather than leaving fullscreen. DVD mode is the whole screen,
so there is nothing to leave, and leaving it used to strand people on a
black VLC window with no way back.
There is no fullscreen toggle, because DVD mode is not a window.
### Leaving
Close, Eject and Esc all do the same thing: ask VLC to quit, and if it
does not, escalate to SIGTERM and then SIGKILL. When VLC exits — however
it exits, including a crash — the session ends and the classroom desktop
and dock come straight back. Nothing can leave a black window behind.
Only one DVD session can run at a time, however fast the button is
pressed.
## Commercial (CSS encrypted) discs
+25 -3
View File
@@ -119,12 +119,34 @@ With `DVD_ENABLED=true`:
- [ ] Closing the player works
- [ ] Ejecting is detected, the icon goes back
- [ ] Reinserting is detected again
- [ ] VLC opens fullscreen, dark, with no menu bar, no orange cone and
no sway title bar
- [ ] The fullscreen controller still appears on mouse movement
- [ ] Commercial CSS disc plays without anyone having run codec setup
by hand
### DVD mode
- [ ] Pressing DVD goes black immediately — no wallpaper, no dock, no
partial VLC window at any point
- [ ] Video or the disc menu appears inside that black surface
- [ ] No VLC chrome anywhere: no menu bar, no fullscreen controller,
no cone, no sway title bar
- [ ] Wallpaper is never visible around VLC
- [ ] Moving the mouse to the bottom slides the classroom bar up
- [ ] It hides again shortly after the mouse leaves it
- [ ] While hidden, clicking a disc menu item near the bottom still
reaches the menu
- [ ] Play/pause toggles and the icon follows the actual state
- [ ] Previous and next chapter work
- [ ] The menu button returns to the disc menu
- [ ] Space pauses; arrow keys and Enter navigate the disc menu
- [ ] Arrow keys do **not** change volume, and no key reaches crop,
aspect ratio, subtitles, audio tracks or deinterlacing
- [ ] Esc leaves DVD mode cleanly, with no black window left behind
- [ ] Close leaves DVD mode cleanly
- [ ] Eject leaves DVD mode and opens the tray
- [ ] Killing VLC by hand also returns to the classroom desktop
- [ ] Pressing DVD twice quickly does not start two sessions
- [ ] The bar is sized by UI_SCALE like the dock
## OTA
- [ ] `./update_canary.sh` publishes package first, manifest last