From 0d21f54cb24df79678637c0feb535d18c5cf7095 Mon Sep 17 00:00:00 2001 From: piterpunk Date: Tue, 28 Jul 2026 00:32:10 -0300 Subject: [PATCH] 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. --- src/lib/platform/PortalInputCapture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/PortalInputCapture.cpp b/src/lib/platform/PortalInputCapture.cpp index 554655600..adcc873f8 100644 --- a/src/lib/platform/PortalInputCapture.cpp +++ b/src/lib/platform/PortalInputCapture.cpp @@ -481,8 +481,8 @@ std::pair PortalInputCapture::mapPortalReleasePosition(double x, return {x, y}; } - auto mappedX = scaleCoordinateBetweenRanges(x, screenLeft, screenRight, portalBounds.left, portalBounds.right); - auto mappedY = scaleCoordinateBetweenRanges(y, screenTop, screenBottom, portalBounds.top, portalBounds.bottom); + auto mappedX = static_cast(std::lround(x)); + auto mappedY = static_cast(std::lround(y)); if (BarrierInfo releaseBarrier; getClosestReleaseBarrier(x, y, screenLeft, screenTop, screenRight, screenBottom, portalBounds, releaseBarrier)) {