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.
This commit is contained in:
Ian Douglas Scott 2024-06-03 14:17:10 -07:00 committed by Victoria Brekenfeld
parent d9a1ec04bd
commit 697ec9e1fe

View file

@ -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,
}
}