Files
hyprland-headless-stream-pl…/docs/TODO/containers-do-not-bind.md
T
Hermenix 7e0544ed70 docs: point the known-gaps list at the TODO folder, and un-stale its first item
Item 1 said the broker reads none of the container or pointer configuration.
That was true and is not: the settings are parsed beside Policy and a switched-off
container host reports itself unavailable with the key named. The item now
records what actually matters about it -- that containers are off on the
deployment machine because no window can be put in one -- and the section links
docs/TODO/, where each open problem has its impact written down.

The TODO folder itself landed in the previous commit by accident (a `git add -A
docs` swept it in with the scroll work); this commit only makes it findable.
2026-10-03 19:06:17 +00:00

3.2 KiB

Containers are built, tested, and switched off

The issue

A session can be given its own container — its own headless output and a numbered workspace — but no window can be assigned to it.

The broker stamps an identity on each session's app and matches a windowrule on match:initial_class, on the assumption that an allowlisted app will carry that stamp. None of them does: chromium reaches the compositor through a wrapper script whose flags do not set a per-session class, and foot has no such option. Every allowlisted app therefore lands in the base class set, the broker judges it foreign to every container, and quarantines it.

The consequence is that enabling containers makes sessions unusable — which is how this was found: not in tests, but live, immediately after the first switch that enabled them. Containers are now off (containers_enabled = false), and every session reports container: {state: "degraded", output: null}, deliberately, so a disabled machine cannot be mistaken for one whose compositor is down.

Ideas

  1. This is already recorded from the other side, in README.dev.md item 4: a window rule only binds for an application that reads the environment, and the fix proposed there is a per-app --app-id in the allowlist — a policy change. Idea 1 below sidesteps the question instead of answering it, because it needs nothing from the application at all.

  2. Adopt windows by the pid the compositor already reports. (recommended) hyprctl clients -j gives each client's pid, and the broker already knows each session's pid — so the join is a lookup, and no app has to take part. No stamp, no per-app flags, and it works for programs that will never co-operate. It must use (pid, starttime) rather than pid alone, because the wrapper replaces its own argv and that is exactly the pid-reuse confusion already fixed once in procmon.

  3. Per-app identity argument, where one exists. chromium accepts --class=hh-<id>, so the wrapper could pass the session's value. Cheap for chromium, and dead weight for every other app: it makes the allowlist a list of apps that cooperate.

  4. Keep the stamp, set it in each wrapper. Same shape as (2), more moving parts, same ceiling.

  5. Hybrid: pid first, stamp as a fallback. Only worth it if some app reports no pid at all; the compositor's -1 sentinel for "absent pid" already covers the reporting side.

Why it matters

The isolation milestone does not deliver while this is open. Sessions still share one output and tile over each other on the same screen — two concurrent sessions are both ready and both visible at once. Per-session ownership today is bookkeeping only: a runtime directory, an idle clock, captured output, an audit trail.

So the difference between what the design claims ("a session owns a workspace") and what the machine does ("a session is an app on a shared screen") is entirely this one join. And note which failure mode to expect on the way: the first half of the feature — creating outputs and workspaces — worked on the first attempt and looked fine right up until an app was put in one. A green container test proves the compositor accepted the commands, not that anything arrived.