Skip to content

Conversation

@jlipton04
Copy link

@jlipton04 jlipton04 commented Jul 24, 2025

Using this autoclicker, I noticed that periodically the cursor would move/appear in the very top-left of my display. I read some of the XLib docs, and found that we can avoid the first call to XWarpPointer(), which moves it to (0, 0), by defining the DestinationWindow as DefaultRootWindow() in relation to the display value. This essentially achieves the same result but without the unnecessary cursor movement.

I can't find any reason this would break existing use-cases, but please let me know if there are any tests I should run. I was able to test/verify this change on my personal machine without any apparent regressions.

@robiot
Copy link
Owner

robiot commented Jul 29, 2025

Hm I wonder why I set it to the absolute position originally

@robiot
Copy link
Owner

robiot commented Jul 29, 2025

If you know that this works I can merge

@jlipton04
Copy link
Author

Yeah, it works. You can see here that this DefaultRootWindow() function is used to get the coordinates initially, so using it as the anchor for those same cursor coordinates here makes sense and should yield the same absolute position on screen.

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.

2 participants