1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Fix input events random delay on X11

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.
This commit is contained in:
PouleyKetchoupp
2021-10-27 15:23:40 -07:00
parent 24fdedfe94
commit ba96fc6a4d
2 changed files with 31 additions and 20 deletions

View File

@@ -268,6 +268,7 @@ class DisplayServerX11 : public DisplayServer {
static void _poll_events_thread(void *ud);
bool _wait_for_events() const;
void _poll_events();
void _check_pending_events(LocalVector<XEvent> &r_events);
static Bool _predicate_all_events(Display *display, XEvent *event, XPointer arg);
static Bool _predicate_clipboard_selection(Display *display, XEvent *event, XPointer arg);