fix(wm): cycle stack focus w/ mff disabled

This commit ensures that the focus changes to the appropriate window
when a container stack is being cycled through by a user who has
disabled the mouse_follows_focus feature.

fix #680
This commit is contained in:
LGUG2Z
2024-02-24 13:01:41 -08:00
parent 0160e8eeeb
commit a6deeef717
2 changed files with 23 additions and 9 deletions

View File

@@ -866,6 +866,20 @@ impl WindowManager {
}
}
// if we passed false for follow_focus
if !follow_focus
// and we have a stack with >1 windows
&& self.focused_container_mut()?.windows().len() > 1
// and we don't have a maxed window
&& self.focused_workspace()?.maximized_window().is_none()
// and we don't have a monocle container
&& self.focused_workspace()?.monocle_container().is_none()
{
if let Ok(window) = self.focused_window_mut() {
window.focus(self.mouse_follows_focus)?;
}
};
Ok(())
}