Repository navigation
Follow the host cursor on cursor events - #142
Open
thtltntdmrhttn wants to merge 1 commit into
Open
thtltntdmrhttn wants to merge 1 commit into
thtltntdmrhttn wants to merge 1 commit into
Conversation
handleCursorEvent only took the host's position when the cursor came back from hidden, so a mouse plugged into the host left our cursor behind (NearFrame#131). take it on every absolute, visible cursor event instead, except right after our own move
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Fixes #131.
With a mouse plugged into the host, the host's cursor moves but OpenParsec's cursor stays wherever touch last left it, and the next touch drags the real cursor back to that spot.
handleCursorEventonly took the host's position when the cursor came back from hidden.Now it takes the position from every absolute, visible cursor event, clamped to the frame. Two cases are skipped:
sendMousePosition, since that is just our own move coming backsetFramehas run for the connection, because the SDK has no dimensions to scale the position with yet (the reconnect path in ParsecView.swift re-sends them for the same reason)The old
prevHiddenblock is folded into this, so the position is set in one place.One limit: the host only sends a cursor event when the pointer changes shape or visibility, not on every move (parsec.h describes
CLIENT_EVENT_CURSORas "a cursor mode change or image update"). So with a host mouse the cursor catches up in steps, each time it crosses a text field, a link or a window edge. It does not glide.If you want the host's pointer to move smoothly, turn on "Display pointer trails" in the Windows mouse settings on the host. Windows then draws the pointer into the stream itself. That works without this change too, and might be worth a line in the README for anyone who lands on #75.
How you tested it
M1 iPad Pro 11", iPadOS 26.6.1, sideloaded builds of this change. Host is Windows 11 with Parsec 150-105c, streaming a virtual display at the iPad's resolution, with an MX Master 4 plugged into the host. Touchpad mode.
Not tested: a macOS host, a game that captures the pointer, Direct touch mode, and I didn't specifically check the cursor position after a reconnect.
Logs
None.