diff --git a/src/layout/floating.rs b/src/layout/floating.rs index d102f40d..075787fd 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -345,16 +345,17 @@ impl FloatingSpace { compute_toplevel_bounds(border_config, self.working_area.size) } - /// Returns the geometry of the active tile relative to and clamped to the working area. + /// Returns the geometry of the active window relative to and clamped to the working area. /// /// During animations, assumes the final tile position. - pub fn active_tile_visual_rectangle(&self) -> Option> { + pub fn active_window_visual_rectangle(&self) -> Option> { let (tile, offset) = self.tiles_with_offsets().next()?; - let tile_size = tile.tile_size(); - let tile_rect = Rectangle::new(offset, tile_size); + let window_pos = offset + tile.window_loc(); + let window_size = tile.window_size(); + let window_rect = Rectangle::new(window_pos, window_size); - self.working_area.intersection(tile_rect) + self.working_area.intersection(window_rect) } pub fn popup_target_rect(&self, id: &W::Id) -> Option> { diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index 53c06069..d71ca55a 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -1342,15 +1342,15 @@ impl Monitor { self.clean_up_workspaces(); } - /// Returns the geometry of the active tile relative to and clamped to the output. + /// Returns the geometry of the active window relative to and clamped to the output. /// /// During animations, assumes the final view position. - pub fn active_tile_visual_rectangle(&self) -> Option> { + pub fn active_window_visual_rectangle(&self) -> Option> { if self.overview_open { return None; } - self.active_workspace_ref().active_tile_visual_rectangle() + self.active_workspace_ref().active_window_visual_rectangle() } fn workspace_size(&self, zoom: f64) -> Size { diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 007bcaf5..9739abdf 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2540,10 +2540,10 @@ impl ScrollingSpace { Some(hint_area) } - /// Returns the geometry of the active tile relative to and clamped to the view. + /// Returns the geometry of the active window relative to and clamped to the view. /// /// During animations, assumes the final view position. - pub fn active_tile_visual_rectangle(&self) -> Option> { + pub fn active_window_visual_rectangle(&self) -> Option> { let col = self.columns.get(self.active_column_idx)?; let final_view_offset = self.view_offset.target(); @@ -2551,12 +2551,12 @@ impl ScrollingSpace { let (tile, tile_off) = col.tiles().nth(col.active_tile_idx).unwrap(); - let tile_pos = view_off + tile_off; - let tile_size = tile.tile_size(); - let tile_rect = Rectangle::new(tile_pos, tile_size); + let window_pos = view_off + tile_off + tile.window_loc(); + let window_size = tile.window_size(); + let window_rect = Rectangle::new(window_pos, window_size); let view = Rectangle::from_size(self.view_size); - view.intersection(tile_rect) + view.intersection(window_rect) } pub fn popup_target_rect(&self, id: &W::Id) -> Option> { diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 49548a83..74487797 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -1609,11 +1609,11 @@ impl Workspace { floating.chain(scrolling) } - pub fn active_tile_visual_rectangle(&self) -> Option> { + pub fn active_window_visual_rectangle(&self) -> Option> { if self.floating_is_active.get() { - self.floating.active_tile_visual_rectangle() + self.floating.active_window_visual_rectangle() } else { - self.scrolling.active_tile_visual_rectangle() + self.scrolling.active_window_visual_rectangle() } } diff --git a/src/niri.rs b/src/niri.rs index ec40e01c..190ef09d 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -934,7 +934,7 @@ impl State { let monitor = self.niri.layout.monitor_for_output(output).unwrap(); let mut rv = false; - let rect = monitor.active_tile_visual_rectangle(); + let rect = monitor.active_window_visual_rectangle(); if let Some(rect) = rect { let output_geo = self.niri.global_space.output_geometry(output).unwrap();