display: auto-grab mouse when the guest draws its own cursor - #207
Merged
Merged
Conversation
When the guest OS draws a hardware cursor into the framebuffer, the SDL host pointer was still shown on top, so the user saw two cursors that did not track each other. Hide the host pointer while a guest cursor is drawn and show it again otherwise, so the user can aim the mouse at the window when no guest cursor is present.
While a guest cursor is drawn, the host mouse is now grabbed automatically so the guest cursor can reach every screen area and the host pointer cannot wander off the window. The grab is released again when the guest cursor disappears, and re-established when the window regains focus, because SDL may drop the grab on focus loss. A manual grab with Ctrl+G is sticky and overrides the automatic behavior.
The window title now reflects whether the mouse is grabbed and how to toggle it, so the user knows how to release the automatic grab and move the pointer to other windows, or how to re-grab it.
probonopd
force-pushed
the
auto-grab-mouse
branch
from
August 8, 2026 22:10
28e0d65 to
49b3701
Compare
Owner
|
A few users are requesting to make this an option, as they find the force grabbing of the cursor annoying. I'll see what I can do regarding this. |
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.
Fixes the double-cursor issue on the SDL display: when the guest OS draws its own (hardware) cursor into the framebuffer, the SDL host pointer was still visible on top, so the user saw two pointers that did not track each other.
Changes: