x11: gate keyboard input and mouse grab on active window PID#2434
Open
awsms wants to merge 1 commit intoares-emulator:masterfrom
Open
x11: gate keyboard input and mouse grab on active window PID#2434awsms wants to merge 1 commit intoares-emulator:masterfrom
awsms wants to merge 1 commit intoares-emulator:masterfrom
Conversation
Prevent keyboard state updates and mouse pointer grab from remaining active when the focused X11 window does not belong to this process. - Keyboard: ignore XQueryKeymap results unless the active _NET_ACTIVE_WINDOW resolves to our PID. - Mouse: automatically release pointer grab when focus leaves our window/process to avoid stuck cursor after alt-tab. - GLX: explicitly set _NET_WM_PID on the GLX child window so focus attribution works reliably. This ensures input is only processed while ares owns focus and avoids global key state leakage or cursor capture issues under X11.
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.
Prevent keyboard state updates and mouse pointer grab from remaining active when the focused X11 window does not belong to this process.
This ensures input is only processed while ares owns focus and avoids global key state leakage or cursor capture issues under X11 and Xwayland. The fix does not impact the Drivers->Input setting "When focus is lost" behavior; controller will still be able to trigger keys if set as "Allow input".
This commit replaces the whole workaround I previously attempted with #2431, to let the X server handling the windows as usual, instead of messing around with the desktop-ui/ logic.
edit: on hold, will try to get the windows fix merged as well. we're still waiting for testing feedback on macOS