Fix a bug where mouse click was not properly detected when mouse sharing is on #45
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.
The Fix:
Added Position Caching: Added fLastX and fLastY to the VMWareMouseFilter class to store the last known raw absolute coordinates from VMWare.
Updated Filter Logic:
When new data is available (numWords > 0), we update fLastX/fLastY with the new raw coordinates.
When no new data is available (numWords == 0):
B_MOUSE_MOVED events are still skipped (as before).
B_MOUSE_DOWN and B_MOUSE_UP events are preserved. Crucially, I now use the cached fLastX/fLastY (if available) to update the event's location.
This ensures that even if you click without moving the mouse (which often results in "no new data" from the VMWare backdoor), the click event is dispatched with the correct absolute coordinates that match where the cursor is visually drawn. This prevents the click from happening at a stale or incorrect location.
The VMWare mouse driver should now handle clicks reliably.