mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-24 10:21:21 +01:00
fix(wm): switch only to different workspaces
Previously a Show event when clicking Firefox tabs would trigger a refocusing of monitors and workspaces every time for a known hwnd, which meant that in practice, the tab would be taken out of the current window and a new window would be created. This commit ensures that the workspace switch is only done if it would be to a different monitor/workspace combination.
This commit is contained in:
@@ -116,9 +116,17 @@ impl WindowManager {
|
||||
}
|
||||
|
||||
if let Some(indices) = switch_to {
|
||||
self.focus_monitor(indices.0)?;
|
||||
self.focus_workspace(indices.1)?;
|
||||
return Ok(());
|
||||
if self.focused_monitor_idx() != indices.0
|
||||
&& self
|
||||
.focused_monitor()
|
||||
.context("there is no monitor")?
|
||||
.focused_workspace_idx()
|
||||
!= indices.1
|
||||
{
|
||||
self.focus_monitor(indices.0)?;
|
||||
self.focus_workspace(indices.1)?;
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
let workspace = self.focused_workspace_mut()?;
|
||||
|
||||
Reference in New Issue
Block a user