diff --git a/src/layout/mod.rs b/src/layout/mod.rs index d78b374e..7f5bbae0 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1615,6 +1615,7 @@ impl Layout { return; }; monitor.switch_workspace_up(); + self.update_insert_hint(); } pub fn switch_workspace_down(&mut self) { @@ -1622,6 +1623,7 @@ impl Layout { return; }; monitor.switch_workspace_down(); + self.update_insert_hint(); } pub fn switch_workspace(&mut self, idx: usize) { @@ -1629,6 +1631,7 @@ impl Layout { return; }; monitor.switch_workspace(idx, false); + self.update_insert_hint(); } pub fn switch_workspace_auto_back_and_forth(&mut self, idx: usize) { @@ -1636,6 +1639,7 @@ impl Layout { return; }; monitor.switch_workspace_auto_back_and_forth(idx); + self.update_insert_hint(); } pub fn switch_workspace_previous(&mut self) { @@ -1643,6 +1647,7 @@ impl Layout { return; }; monitor.switch_workspace_previous(); + self.update_insert_hint(); } pub fn consume_into_column(&mut self) { @@ -1994,6 +1999,19 @@ impl Layout { } } } + + fn update_insert_hint(&mut self) { + if let Some(move_) = &self.interactive_move { + if let Some(workspace) = self.workspace_for_output_mut(&move_.output) { + let position = workspace.get_insert_position(move_.get_pointer_loc()); + workspace.set_insert_hint(InsertHint { + position, + width: move_.width, + is_full_width: move_.is_full_width, + }); + } + } + } pub fn ensure_named_workspace(&mut self, ws_config: &WorkspaceConfig) { if self.find_workspace_by_name(&ws_config.name.0).is_some() {