diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 97f677c7..92a815b6 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2464,6 +2464,7 @@ impl ScrollingSpace { pub fn tiles_with_ipc_layouts(&self) -> impl Iterator, WindowLayout)> { let scale = self.scale; + let view = Rectangle::from_size(self.view_size); let view_pos = self.target_view_pos(); self.columns @@ -2482,12 +2483,21 @@ impl ScrollingSpace { // Round to physical pixels. let pos = pos.to_physical_precise_round(scale).to_logical(scale); - let layout = WindowLayout { + let mut layout = WindowLayout { // Our indices are 1-based, consistent with the actions. pos_in_scrolling_layout: Some((col_idx + 1, tile_idx + 1)), tile_pos_in_workspace_view: Some(pos.into()), ..tile.ipc_layout_template() }; + + // Clear out tile_pos_in_workspace_view for tiles outside of the workspace + // view to avoid IPC spam. E.g. so that any scrolling on a workspace with + // 100 columns didn't have to send 100 window layout changes. + let bbox = Rectangle::new(pos, Size::from(layout.tile_size)); + if bbox.intersection(view).is_none() { + layout.tile_pos_in_workspace_view = None; + } + (tile, layout) }) })