From b6fc9d9c59bc5529aa0313d5205cb427b25dad1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C8=9Bca=20Dumitru?= Date: Tue, 20 Oct 2026 00:21:33 +0300 Subject: [PATCH] ipc: Provide a value for tile_pos_in_workspace_view in scrolling layout Co-authored-by: Szybet <53944559+Szybet@users.noreply.github.com> --- src/layout/scrolling.rs | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 4f462c65..97f677c7 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2463,18 +2463,33 @@ impl ScrollingSpace { } pub fn tiles_with_ipc_layouts(&self) -> impl Iterator, WindowLayout)> { + let scale = self.scale; + let view_pos = self.target_view_pos(); + self.columns .iter() + .zip(self.column_xs(self.data.iter().copied())) .enumerate() - .flat_map(move |(col_idx, col)| { - col.tiles().enumerate().map(move |(tile_idx, (tile, _))| { - let layout = WindowLayout { - // Our indices are 1-based, consistent with the actions. - pos_in_scrolling_layout: Some((col_idx + 1, tile_idx + 1)), - ..tile.ipc_layout_template() - }; - (tile, layout) - }) + .flat_map(move |(col_idx, (col, col_x))| { + // Do not include animated render offset here consistently with floating. + let col_off = Point::from((col_x - view_pos, 0.)); + + col.tiles() + .enumerate() + .map(move |(tile_idx, (tile, tile_off))| { + // Do not include animated render offset here consistently with floating. + let pos = col_off + tile_off; + // Round to physical pixels. + let pos = pos.to_physical_precise_round(scale).to_logical(scale); + + let 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() + }; + (tile, layout) + }) }) }