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
This commit is contained in:
Hendrik Hamerlinck 2025-11-25 20:45:24 +01:00 committed by Ian Douglas Scott
parent 6025f483d6
commit 714e80366d

View file

@ -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<FocusTarget> for CosmicSurface {
}
}
impl Hash for FocusTarget {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
match self {
FocusTarget::Window(window) => window.hash(state),
FocusTarget::Fullscreen(surface) => surface.hash(state),
}
}
}
impl From<CosmicMapped> for FocusTarget {
fn from(value: CosmicMapped) -> Self {
Self::Window(value)