fix(wayland): Corrects the cursor coordinates mapping at primary desktop

Remapping the cursor coordinates to the portal edge size makes the mouse
position being relative to the edge size, in a multi-monitor environment
this edge can be in only one of the monitors and the cursor coordinates
got wrong.

This changes uses the full height and the full width of the combined
monitors to set the mouse cursor position, cropped by the portal edge
size.
This commit is contained in:
piterpunk 2026-07-28 00:32:10 -03:00 committed by Chris Rizzitello
parent 40f743fb37
commit 0d21f54cb2

View file

@ -481,8 +481,8 @@ std::pair<double, double> PortalInputCapture::mapPortalReleasePosition(double x,
return {x, y}; return {x, y};
} }
auto mappedX = scaleCoordinateBetweenRanges(x, screenLeft, screenRight, portalBounds.left, portalBounds.right); auto mappedX = static_cast<std::int32_t>(std::lround(x));
auto mappedY = scaleCoordinateBetweenRanges(y, screenTop, screenBottom, portalBounds.top, portalBounds.bottom); auto mappedY = static_cast<std::int32_t>(std::lround(y));
if (BarrierInfo releaseBarrier; if (BarrierInfo releaseBarrier;
getClosestReleaseBarrier(x, y, screenLeft, screenTop, screenRight, screenBottom, portalBounds, releaseBarrier)) { getClosestReleaseBarrier(x, y, screenLeft, screenTop, screenRight, screenBottom, portalBounds, releaseBarrier)) {