-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
[3.x] Fix input events random delay on X11 #54313
Conversation
bd4f3aa
to
874c9ae
Compare
The new system based on a thread gathering events from the X11 server was causing delays in some scenarios where some events have just been missed at the time of processing and we're waiting for a whole frame to check them again. Solved by flushing again and checking for pending events at the beginning of the process loop, in addition to events already gathered on the event thread.
I've tested this patch and the input event delay feels so much less than before. I have a personal project where I would get a 1 to 3 seconds of input delay without this patch, but with it I can't reproduce that at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Will merge for 3.5 and 3.4.1 indeed, even if it really looks like something I'd want in 3.4 :D
Could possibly go to 3.3.5 too.
I need to build 3.4 RC 3 to validate a few other fixes, and I really really want this in 3.4, so... YOLO merge :P The changes seem fairly safe to me, worst case we might be polling a bit more than we should, but that's better than missing or delaying events. |
Thanks! |
The new system based on a thread gathering events from the X11 server was causing delays in some scenarios where some events have just been missed at the time of processing and we're waiting for a whole frame to check them again.
Solved by flushing again and checking for pending events at the beginning of the process loop, in addition to events already gathered on the event thread.
Fixes #48369 on 3.x (regression from #42341).
Master version: #54326
Note for the milestone:
It seems a bit risky to merge at the last minute for 3.4 release, so I've set the milestone to 3.5, but it could be a good candidate for a minor 3.4 release later, as long as there's a little bit more time for user testing.