fix: clamp pointer edge after applying the output offset

This commit is contained in:
Hojjat 2026-07-27 15:41:58 -06:00 • committed by Victoria Brekenfeld
parent 9514b4945e
commit 8d450d4977

View file

@ -393,10 +393,12 @@ impl State {
// - output_geometry.size so that we don't send leave events to a fullscreen app
// - logical size so that the position doesn't end up outside the actual size of the output
// See https://github.com/pop-os/cosmic-comp/pull/2568
let max_x = output_geometry_loc.x
+ logical.w.min(output_geometry.size.w as f64).next_down();
let max_y = output_geometry_loc.y
+ logical.h.min(output_geometry.size.h as f64).next_down();
let max_x = (output_geometry_loc.x
+ logical.w.min(output_geometry.size.w as f64))
.next_down();
let max_y = (output_geometry_loc.y
+ logical.h.min(output_geometry.size.h as f64))
.next_down();
position.x = position.x.clamp(output_geometry_loc.x, max_x);
position.y = position.y.clamp(output_geometry_loc.y, max_y);