From 697ec9e1fe96735a639748b0a8a37ca852bf6a42 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 3 Jun 2024 14:17:10 -0700 Subject: [PATCH] Use `active()` instead of `surfaces().any` in stack `same_client_as` Setting the clipboard is only allowed when the keyboard focus is the same client as the client trying to set the clipboard. We shouldn't allow background windows in stacks to set the clipboard. I don't know if anything else expects `same_client_as` to have this `any` behavior. --- src/shell/element/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/element/mod.rs b/src/shell/element/mod.rs index e9bbedfa..0bf5542e 100644 --- a/src/shell/element/mod.rs +++ b/src/shell/element/mod.rs @@ -952,7 +952,7 @@ impl WaylandFocus for CosmicMapped { fn same_client_as(&self, object_id: &ObjectId) -> bool { match &self.element { CosmicMappedInternal::Window(w) => w.surface().same_client_as(object_id), - CosmicMappedInternal::Stack(s) => s.surfaces().any(|w| w.same_client_as(object_id)), + CosmicMappedInternal::Stack(s) => s.active().same_client_as(object_id), _ => false, } }