Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

steamcompmgr: Use XInput2 RawMotion events as a hint to update cursor pos #1071

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

misyltoad
Copy link
Collaborator

Taking a page out of XEyes' book to get the cursor position (even when the cursor is grabbed, etc) by only doing so when we get a RawMotion event -- and only register for those when we know there's a cursor image that we would want to render.

This is a kinda crap workaround for the fact that we cannot directly just recieve information about the cursor from the XServer, even as the X11 WM due to cursor grabbing, input masking and other such nonsense.

An alternative would be using something like libei and having XTest funnel through that -- however that needs work to be functional on nested compositors.

… pos

Taking a page out of XEyes' book to get the cursor position (even when the cursor is grabbed, etc) by only doing so when we get a RawMotion event -- and only register for those when we know there's a cursor image that we would want to render.

This is a kinda crap workaround for the fact that we cannot directly just recieve information about the cursor from the XServer, even as the X11 WM due to cursor grabbing, input masking and other such nonsense.

An alternative would be using something like libei and having XTest funnel through that -- however that needs work to be functional on nested compositors.
@sharkautarch
Copy link

I did some profiling comparing the gamescope-xwm thread's hotspots w/ gamescope/master -> gamescope/xinput2-cursorevents. This PR seems to get rid of all of the MouseCursor:: related hotspots.
Good work @Joshua-Ashton !

@ishitatsuyuki
Copy link

I can also confirm that this runs fine and this gets rid of all the round trips spent in XQueryPointer. A part of the cost is moved to reading the events instead, but looking at the profile this should be easily a 25% work reduction overall on the xwm thread.

@misyltoad
Copy link
Collaborator Author

Well, that cost should only be incurred when the cursor is visible given we set/unset the mask.

Thanks for testing.

@misyltoad misyltoad merged commit d7758a8 into master Dec 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants