mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
floating: Constrain popups to working area
This commit is contained in:
@@ -335,13 +335,10 @@ impl<W: LayoutElement> FloatingSpace<W> {
|
|||||||
pub fn popup_target_rect(&self, id: &W::Id) -> Option<Rectangle<f64, Logical>> {
|
pub fn popup_target_rect(&self, id: &W::Id) -> Option<Rectangle<f64, Logical>> {
|
||||||
for (tile, pos) in self.tiles_with_offsets() {
|
for (tile, pos) in self.tiles_with_offsets() {
|
||||||
if tile.window().id() == id {
|
if tile.window().id() == id {
|
||||||
// TODO: intersect with working area width.
|
// Position within the working area.
|
||||||
let width = tile.window_size().w;
|
let mut target = self.working_area;
|
||||||
let height = self.working_area.size.h;
|
target.loc -= pos;
|
||||||
|
target.loc -= tile.window_loc();
|
||||||
let mut target = Rectangle::from_loc_and_size((0., 0.), (width, height));
|
|
||||||
target.loc.y -= pos.y;
|
|
||||||
target.loc.y -= tile.window_loc().y;
|
|
||||||
|
|
||||||
return Some(target);
|
return Some(target);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user