Skip to content

Commit

Permalink
fix: set the workspace of the activated token's surface to urgent if …
Browse files Browse the repository at this point in the history
…not focusing it
  • Loading branch information
wash2 authored and Drakulix committed Nov 16, 2023
1 parent b33c1dc commit 495d772
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/wayland/handlers/xdg_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 495d772

Please sign in to comment.