Correctly handle window geometry loc in Focus::under

`Focus::under` replaced code in 4 places, that were inconsistent in how
they handled this. This seems to be more correct, in each case.
This commit is contained in:
Ian Douglas Scott 2024-03-28 13:36:38 -07:00 committed by Victoria Brekenfeld
parent 418954a34b
commit 7cd13ec6a9

View file

@ -115,8 +115,8 @@ impl Focus {
header_height: i32,
location: Point<f64, Logical>,
) -> Option<Focus> {
let loc = location.to_i32_round::<i32>();
let geo = surface.geometry();
let loc = location.to_i32_round::<i32>() - geo.loc;
if loc.y < 0 && loc.x < 0 {
Some(Focus::ResizeTopLeft)
} else if loc.y < 0 && loc.x >= geo.size.w {