xdg-activation: Switch stack focus

This commit is contained in:
Victoria Brekenfeld 2023-11-14 17:30:11 +01:00 committed by Victoria Brekenfeld
parent a0aa8fb8b2
commit 14867a0893
3 changed files with 21 additions and 5 deletions

View file

@ -128,6 +128,20 @@ impl XdgActivationHandler for State {
.raise_element(&element, true);
}
if element.is_stack() {
if let Some((window, _)) = element.windows().find(|(window, _)| {
let mut found = false;
window.with_surfaces(|wl_surface, _| {
if wl_surface == &surface {
found = true;
}
});
found
}) {
element.set_active(&window);
}
}
let target = element.into();
if workspace == &current_workspace.handle {
Shell::set_focus(self, Some(&target), &seat, None);