From 714e80366d31edf0c5fd0e8231f6f97e84fad929 Mon Sep 17 00:00:00 2001 From: Hendrik Hamerlinck Date: Tue, 25 Nov 2025 20:45:24 +0100 Subject: [PATCH] fix: properly remove elements from the focus_stack shift_remove could not delete the element in it's stack because indexmap::Equivalent requires the hashes to be equivalent --- src/shell/focus/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/shell/focus/mod.rs b/src/shell/focus/mod.rs index 311faf8b..582a9c81 100644 --- a/src/shell/focus/mod.rs +++ b/src/shell/focus/mod.rs @@ -29,7 +29,7 @@ use super::{SeatExt, grabs::SeatMoveGrabState, layout::floating::FloatingLayout} mod order; pub mod target; -#[derive(Debug, Clone, Hash, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum FocusTarget { Window(CosmicMapped), Fullscreen(CosmicSurface), @@ -59,6 +59,15 @@ impl indexmap::Equivalent for CosmicSurface { } } +impl Hash for FocusTarget { + fn hash(&self, state: &mut H) { + match self { + FocusTarget::Window(window) => window.hash(state), + FocusTarget::Fullscreen(surface) => surface.hash(state), + } + } +} + impl From for FocusTarget { fn from(value: CosmicMapped) -> Self { Self::Window(value)