focus-stack: Keep dragged surface in focus stack in move_request()

Replacement for https://github.com/pop-os/cosmic-comp/pull/1687, that
works correctly with multiple outputs.

We don't want another window to show a focus indicator while a window is
being dragged, so keep the window in the focus stack. If a window is
being moved out of a stack, change the focus from the stack to the
window.

`refresh_focus_stack()` doesn't seem to be called here, but for good
measure, make sure that calling that function also won't remove a
`CosmicMapped` from the focus stack if it is currently part of a move
grab for the seat.
This commit is contained in:
Ian Douglas Scott 2025-10-30 13:59:26 -07:00 committed by Ian Douglas Scott
parent e09fcec9f3
commit 7fd033295f
3 changed files with 29 additions and 13 deletions

View file

@ -129,11 +129,11 @@ impl FocusStackMut<'_> {
self.0.insert(target);
}
pub fn remove<T>(&mut self, target: &T)
pub fn remove<T>(&mut self, target: &T) -> bool
where
T: Hash + indexmap::Equivalent<FocusTarget>,
{
self.0.shift_remove(target);
self.0.shift_remove(target)
}
pub fn last(&self) -> Option<&FocusTarget> {