floating: Constrain popups to working area
Browse files at this commitf66a49bc42f9352ac77a926617dd8a9cdaef0b9bParent: baf78cc1 changed file +4 -7
- src/layout/floating.rs +4 -7
src/layout/floating.rsmodified+4 -7
| @@ -335,13 +335,10 @@ impl<W: LayoutElement> FloatingSpace<W> { | |||
| 335 | pub fn popup_target_rect(&self, id: &W::Id) -> Option<Rectangle<f64, Logical>> { | 335 | pub fn popup_target_rect(&self, id: &W::Id) -> Option<Rectangle<f64, Logical>> { |
| 336 | for (tile, pos) in self.tiles_with_offsets() { | 336 | for (tile, pos) in self.tiles_with_offsets() { |
| 337 | if tile.window().id() == id { | 337 | if tile.window().id() == id { |
| 338 | - // TODO: intersect with working area width. | 338 | + // Position within the working area. |
| 339 | - let width = tile.window_size().w; | 339 | + let mut target = self.working_area; |
| 340 | - let height = self.working_area.size.h; | 340 | + target.loc -= pos; |
| 341 | - | 341 | + target.loc -= tile.window_loc(); |
| 342 | - let mut target = Rectangle::from_loc_and_size((0., 0.), (width, height)); | ||
| 343 | - target.loc.y -= pos.y; | ||
| 344 | - target.loc.y -= tile.window_loc().y; | ||
| 345 | 342 | ||
| 346 | return Some(target); | 343 | return Some(target); |
| 347 | } | 344 | } |