aboutsummaryrefslogtreecommitdiff
path: root/src/layout/floating.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-26 09:27:59 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commitf66a49bc42f9352ac77a926617dd8a9cdaef0b9b (patch)
tree14fd7c40d7c8f6a45a20b79e5e700c9f9bfb40df /src/layout/floating.rs
parentbaf78ccda28b2a8992ba1ae3739d166167c9ee5f (diff)
downloadniri-f66a49bc42f9352ac77a926617dd8a9cdaef0b9b.tar.gz
niri-f66a49bc42f9352ac77a926617dd8a9cdaef0b9b.tar.bz2
niri-f66a49bc42f9352ac77a926617dd8a9cdaef0b9b.zip
floating: Constrain popups to working area
Diffstat (limited to 'src/layout/floating.rs')
-rw-r--r--src/layout/floating.rs11
1 files 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<W: LayoutElement> FloatingSpace<W> {
pub fn popup_target_rect(&self, id: &W::Id) -> Option<Rectangle<f64, Logical>> {
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);
}