fix: set the workspace of the activated token's surface to urgent if not focusing it

This commit is contained in:
Ashley Wulber 2023-11-16 12:00:27 -05:00 committed by Victoria Brekenfeld
parent b33c1dc9f7
commit 495d772a38

View file

@ -117,11 +117,12 @@ impl XdgActivationHandler for State {
let current_output = seat.active_output();
let current_workspace = self.common.shell.active_space_mut(&current_output);
if current_workspace
let in_current_workspace = current_workspace
.floating_layer
.mapped()
.any(|m| m == &element)
{
.any(|m| m == &element);
if in_current_workspace {
current_workspace
.floating_layer
.space
@ -143,11 +144,14 @@ impl XdgActivationHandler for State {
}
let target = element.into();
if workspace == &current_workspace.handle {
if workspace == &current_workspace.handle && in_current_workspace {
Shell::set_focus(self, Some(&target), &seat, None);
} else {
} else if let Some((w, _)) = target
.toplevel()
.and_then(|t| self.common.shell.workspace_for_surface(&t))
{
Shell::append_focus_stack(self, Some(&target), &seat);
self.common.shell.set_urgent(workspace);
self.common.shell.set_urgent(&w);
}
}
}