layout: Switch to workspace on window activation if not transitioning

This should not be possible to trigger at the moment, but with
xdg-activation it will be.
This commit is contained in:
Ivan Molodetskikh
2023-11-24 09:49:39 +04:00
parent 3473965091
commit 25fd6a0e04
+7 -2
View File
@@ -818,11 +818,16 @@ impl<W: LayoutElement> Layout<W> {
};
for (monitor_idx, mon) in monitors.iter_mut().enumerate() {
for (_workspace_idx, ws) in mon.workspaces.iter_mut().enumerate() {
for (workspace_idx, ws) in mon.workspaces.iter_mut().enumerate() {
if ws.has_window(window) {
*active_monitor_idx = monitor_idx;
// FIXME: switch to this workspace if not already switching.
ws.activate_window(window);
// Switch to that workspace if not already during a transition.
if mon.workspace_switch.is_none() {
mon.switch_workspace(workspace_idx);
}
break;
}
}