fix(macos): warp cursor to center on leave to fix first-move jump
When macOS is the primary screen, hotkey switching to a secondary screen can leave the local cursor baseline away from the hidden-cursor center. The first physical mouse movement is then interpreted as a large secondary-screen delta. Align macOS primary leave behavior with the Windows and X11 implementations by logging and warping the cursor to the primary-screen center before marking the screen off screen. OSXScreen::warpCursor also updates m_xCursor and m_yCursor, so the next motion delta starts from the expected center baseline. Impact is limited to macOS primary/server leave handling; macOS secondary/client leave behavior and non-macOS builds are unchanged.
This commit is contained in:
parent
e07cfcc995
commit
e8a474ba7d
1 changed files with 2 additions and 0 deletions
|
|
@ -798,6 +798,8 @@ void OSXScreen::leave()
|
||||||
|
|
||||||
if (m_isPrimary) {
|
if (m_isPrimary) {
|
||||||
avoidHesitatingCursor();
|
avoidHesitatingCursor();
|
||||||
|
LOG_VERBOSE("centering cursor on leave: %+d, %+d", m_xCenter, m_yCenter);
|
||||||
|
warpCursor(m_xCenter, m_yCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// now off screen
|
// now off screen
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue