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

[3.x] Fix input events random delay on X11 #54313

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Oct 27, 2021

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.

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.
@pouleyKetchoupp pouleyKetchoupp changed the title Fix input events random delay on X11 [3.x] Fix input events random delay on X11 Oct 27, 2021
@Rubonnek
Copy link
Member

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.

Copy link
Member

@akien-mga akien-mga left a 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.

@akien-mga
Copy link
Member

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.

@akien-mga akien-mga modified the milestones: 3.5, 3.4 Nov 2, 2021
@akien-mga akien-mga merged commit 2c47e33 into godotengine:3.x Nov 2, 2021
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the x11-fix-input-delay-3.x branch November 4, 2021 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input events are occasionally skipped (regression from input handling changes in 3.3)
3 participants