Replace privileged field with a not_sandboxed() method

`privileged` now only indicates if a client is "sandboxed", i.e. it has
a security context, where the sandbox engine isn't cosmic-panel.

So replace the field with a method that's a bit more descriptive.
This commit is contained in:
Ian Douglas Scott 2025-10-27 18:43:55 -07:00 committed by Victoria Brekenfeld
parent 1bea97d42a
commit f91115fb45
3 changed files with 28 additions and 19 deletions

View file

@ -44,8 +44,6 @@ impl SecurityContextHandler for State {
client_stream,
Arc::new(ClientState {
security_context: Some(security_context.clone()),
privileged: security_context.sandbox_engine.as_deref()
== Some("com.system76.CosmicPanel"),
advertised_drm_node: drm_node,
..new_state
}),

View file

@ -39,7 +39,7 @@ impl XdgActivationHandler for State {
})
.and_then(|data| {
data.downcast_ref::<ClientState>()
.map(|data| data.privileged)
.map(|data| data.not_sandboxed())
})
.unwrap_or(false)
{