3ffec30d51
Godot suppresses X11 BadWindow errors during some operations because they can occur with normal usage. X11 errors are asynchronous. Sometimes, when a BadWindow error is sent, it is dequeued after the original non-BadWindow-suppressing error handler has been restored. This results in an error callstack being shown to the user. Call `XSync` before restoring the original error handler. This ensures that any queued BadWindow errors go to the suppressing handler. Fixes #117814