Skip to content

util: let wlr_box_closest_point() be within 1/65536 of right/bottom edge

John Lindgren requested to merge jlindgren90/wlroots:closest-point-redo into master

Limiting the position to (x + width - 1, y + height - 1) created an issue where it became difficult to move high-resolution mice between outputs in sway, since motion deltas were <1px.

See: https://github.com/swaywm/sway/issues/8110

Using (x + width - 1/256, y + height - 1/256) should be sufficient since the cursor position on-the-wire is in 24.8 fixed-point.

This does expose a client-side bug in Qt layer-shell applications, noticeable in right/bottom panels which do not accept positions beyond (x + width - 1, x + height - 1) as valid - thus driving the cursor to the bottom/right of the screen to click on the panel does not work. I don't have a good workaround for this, and probably it needs to be fixed in Qt itself.

Fixes: 3fc66d45 ("util: fix non-linear behavior of wlr_box_closest_point()")

Merge request reports