feat(wm): add mouse follows focus toggle

This commit adds a toggle for the mouse follows focus behaviour that has
been the default for komorebi until now.

resolve #63
This commit is contained in:
LGUG2Z
2021-10-29 10:04:19 -07:00
parent 7fd545ca35
commit a55069df48
10 changed files with 77 additions and 43 deletions

View File

@@ -45,11 +45,11 @@ pub fn new(id: isize, size: Rect, work_area_size: Rect) -> Monitor {
}
impl Monitor {
pub fn load_focused_workspace(&mut self) -> Result<()> {
pub fn load_focused_workspace(&mut self, mouse_follows_focus: bool) -> Result<()> {
let focused_idx = self.focused_workspace_idx();
for (i, workspace) in self.workspaces_mut().iter_mut().enumerate() {
if i == focused_idx {
workspace.restore()?;
workspace.restore(mouse_follows_focus)?;
} else {
workspace.hide();
}