Skip to content

feat(compositor): security-context, idle-notify, content-type, foreign-toplevel-list and alpha-modifier (#1046) - #1061

Open
hanthor wants to merge 1 commit into
lane/layer-shell-filter-1048from
lane/protocols-wiring-1046
Open

hanthor wants to merge 1 commit into
lane/layer-shell-filter-1048from
lane/protocols-wiring-1046

Conversation

@hanthor

@hanthor hanthor commented Nov 10, 2026

Copy link
Copy Markdown
Member

Closes #1046. Part of #577. Stacked on #1057 (base lane/layer-shell-filter-1048), which introduced the shell-only filter and the EXPECTED/SHELL_ONLY golden split; retarget to main after #1057 merges.

All five are in the vendored Smithay 0.7.0; Mutter 51 advertises none of them (recorded under Deliberate differences in docs/protocols.md).

  • wp_security_context_manager_v1 v1: ClientState carries the context (engine, app id, instance id); new listeners are put on the loop after each client dispatch (Runtime::admit_security_contexts). ClientState::privileged refuses sandboxed clients for virtual keyboard, input method, layer shell, foreign toplevel list, mutter_x11_interop, ext_session_lock_manager_v1 (as sway does) and the manager itself.
  • ext_idle_notifier_v1 v2: new crates/compositor/src/idle_notify.rs on the IdleMonitor's clock, fed at the same three activity points; get_idle_notification honours idle inhibitors, get_input_idle_notification ignores them (protocol XML); next due time joins the loop's wake-up.
  • wp_content_type_manager_v1 v1: stored per surface (protocols::surface_content_type), recorded for future VRR/scheduling.
  • ext_foreign_toplevel_list_v1 v1: shell-only; WindowManager::reconcile syncs one handle per model window with title/app id and closed on removal.
  • wp_alpha_modifier_v1 v1: Smithay's surface render element already applies the multiplier.
  • docs/security-model.md: window-metadata rule and privileged globals cover the list and security contexts. tests/x11_gates.rs: reviewed exception for ext_foreign_toplevel_list_v1 in the shell's registry.

Tests (crates/compositor/tests/protocols.rs): golden lists (+ SANDBOX_HIDDEN), security_context_clients_see_no_privileged_global, idle_notifications_fire_after_their_timeout_and_resume_on_input, idle_inhibitors_hold_back_only_ordinary_idle_notifications, the_shell_lists_toplevels_until_they_close_and_apps_cannot_bind_the_list, content_type_hint_is_recorded_per_surface_on_commit.

Local checks (clean target): cargo fmt --all, cargo clippy --workspace --all-targets -D warnings, cargo test -p tuna-compositor --lib (1058 passed) and --test protocols/x11_gates/layer/windows/input_protocols/session_lock_protocol/popups (all pass), scripts/tuna-test-strategy. G-WAYLAND-INFO reports extra globals as "Tuna Desktop only" without failing. Not run: a real Flatpak client through a security context.

…n-toplevel-list and alpha-modifier (#1046)

Wire protocols the vendored Smithay 0.7.0 already implements:
- wp_security_context_v1: sandbox listeners admitted on the loop; clients
  inside a context are refused every privileged global (virtual keyboard,
  input method, layer shell, foreign toplevel list, mutter_x11_interop,
  session lock, the context manager itself).
- ext_idle_notifier_v1 v2: on the IdleMonitor's clock and activity feed;
  idle inhibitors hold back get_idle_notification only.
- wp_content_type_v1: recorded per surface.
- ext_foreign_toplevel_list_v1: shell-only; handles follow the window
  model's titles and app ids and close with the window.
- wp_alpha_modifier_v1: applied by Smithay's surface elements.

Signed-off-by: James Reilly <jreilly1821@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant