diff --git a/src/wayland/handlers/security_context.rs b/src/wayland/handlers/security_context.rs index 105d66fd..666e18eb 100644 --- a/src/wayland/handlers/security_context.rs +++ b/src/wayland/handlers/security_context.rs @@ -32,6 +32,8 @@ impl SecurityContextHandler for State { .map(|data| data.privileged) .unwrap_or(false); + let new_state = state.new_client_state(); + let drm_node = client_data .as_ref() .and_then(|data| data.downcast_ref::()) @@ -41,7 +43,8 @@ impl SecurityContextHandler for State { .as_ref() .and_then(|data| data.downcast_ref::()) .and_then(|data| data.user_data().get::().cloned()) - }); + }) + .or_else(|| new_state.drm_node.clone()); if let Err(err) = state.common.display_handle.insert_client( client_stream, @@ -51,7 +54,7 @@ impl SecurityContextHandler for State { && security_context.sandbox_engine.as_deref() == Some("com.system76.CosmicPanel"), drm_node, - ..state.new_client_state() + ..new_state }), ) { warn!(?err, "Error adding wayland client");