From f66a49bc42f9352ac77a926617dd8a9cdaef0b9b Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 26 Dec 2024 09:27:59 +0300 Subject: floating: Constrain popups to working area --- src/layout/floating.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/layout/floating.rs b/src/layout/floating.rs index 2793a991..547c9222 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -335,13 +335,10 @@ impl FloatingSpace { pub fn popup_target_rect(&self, id: &W::Id) -> Option> { for (tile, pos) in self.tiles_with_offsets() { if tile.window().id() == id { - // TODO: intersect with working area width. - let width = tile.window_size().w; - let height = self.working_area.size.h; - - let mut target = Rectangle::from_loc_and_size((0., 0.), (width, height)); - target.loc.y -= pos.y; - target.loc.y -= tile.window_loc().y; + // Position within the working area. + let mut target = self.working_area; + target.loc -= pos; + target.loc -= tile.window_loc(); return Some(target); } -- cgit