mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
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:
+7
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user