Windows: Mouse coordinates become offset after moving and maximizing the control window on another monitor
Bug Description
I found a mouse coordinate offset bug in RustDesk remote control.
My local/controller computer is PC-X, with Monitor A (19-inch) and Monitor B (23-inch). My remote/controlled device is PC-Y, with Monitor C (19-inch). PC-X runs Windows 11 and RustDesk 1.5.0. PC-Y runs Windows 10 and RustDesk 1.5.0.
When controlling PC-Y from PC-X, the control window is windowed and snapped/docked to the left/right half of Monitor A. The window scale mode is set to “Original size”, and the scroll mode is set to “Scrollbars”. Because Monitor A and Monitor C are both 19-inch, the usable height of the control window is reduced by the control window title bar and Monitor A’s taskbar, so scrollbars appear in the control window.
When I drag the scrollbar to the bottom, so that PC-Y’s full taskbar is visible, the mouse coordinates in the control window are correct and there is no offset. However, after I drag the control window to Monitor B and maximize it, Monitor C’s content becomes centered and surrounded by black bars, and the mouse coordinates become offset.
How to Reproduce
From PC-X, connect to and control PC-Y.
Keep the control window in windowed mode and snap/dock it to the left half of Monitor A.
Set the window scale mode to “Original size” and the scroll mode to “Scrollbars”. Because Monitor A and Monitor C are both 19-inch, the usable height of the control window is reduced by the title bar and Monitor A’s taskbar, causing scrollbars to appear.
Drag the scrollbar to the bottom until PC-Y’s full taskbar is visible. At this point, the mouse coordinates in the control window are correct, with no offset.
Drag the control window to Monitor B and maximize it. Monitor C’s content is centered with black bars around it.
The mouse coordinates become offset.
Expected Behavior
The mouse coordinates should remain accurate and aligned with the remote cursor regardless of moving or maximizing the control window, monitor size/resolution, scrollbar position, or letterboxing/black bars.
Operating system(s) on local (controlling) side and remote (controlled) side
Windows 11 -> Windows 10
RustDesk Version(s) on local (controlling) side and remote (controlled) side
1.5.0 -> 1.5.0
Screenshots
https://github.com/user-attachments/assets/d347330b-881d-458e-a144-37bb6dc093c1
Additional Context
No response
Source: rustdesk/rustdesk