Skip to content

Commit

Permalink
fix: be able to focus fullscreen windows on cross-workspace focus cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
lars-berger committed Aug 7, 2024
1 parent e772130 commit 564e316
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions packages/wm/src/containers/commands/focus_in_direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,23 @@ fn workspace_focus_target(
.monitor_in_direction(&monitor, direction)?
.and_then(|monitor| monitor.displayed_workspace());

let focus_target = target_workspace
let focused_fullscreen = target_workspace
.as_ref()
.and_then(|workspace| {
workspace
.descendant_in_direction(&direction.inverse())
.map(Into::into)
.and_then(|workspace| workspace.descendant_focus_order().next())
.filter(|focused| match focused {
Container::NonTilingWindow(window) => {
matches!(window.state(), WindowState::Fullscreen(_))
}
_ => false,
});

let focus_target = focused_fullscreen
.or_else(|| {
target_workspace.as_ref().and_then(|workspace| {
workspace
.descendant_in_direction(&direction.inverse())
.map(Into::into)
})
})
.or(target_workspace.map(Into::into));

Expand Down

0 comments on commit 564e316

Please sign in to comment.