forge
Explore
Log in

Don't you dare go Hollow

layout: Switch to workspace on window activation if not transitioning

Browse files at this commit

25fd6a0e04c5421dbdf5504a7be0ac33bf8bc88cIvan MolodetskikhParent: 3473965
This should not be possible to trigger at the moment, but with
xdg-activation it will be.
src/layout.rsmodified+7 -2
@@ -818,11 +818,16 @@ impl<W: LayoutElement> Layout<W> {
818 };818 };
819 819
820 for (monitor_idx, mon) in monitors.iter_mut().enumerate() {820 for (monitor_idx, mon) in monitors.iter_mut().enumerate() {
821- for (_workspace_idx, ws) in mon.workspaces.iter_mut().enumerate() {821+ for (workspace_idx, ws) in mon.workspaces.iter_mut().enumerate() {
822 if ws.has_window(window) {822 if ws.has_window(window) {
823 *active_monitor_idx = monitor_idx;823 *active_monitor_idx = monitor_idx;
824- // FIXME: switch to this workspace if not already switching.
825 ws.activate_window(window);824 ws.activate_window(window);
825+
826+ // Switch to that workspace if not already during a transition.
827+ if mon.workspace_switch.is_none() {
828+ mon.switch_workspace(workspace_idx);
829+ }
830+
826 break;831 break;
827 }832 }
828 }833 }