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

Fix BadWindow error when stopping embedded game on Linux #102045

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented Jan 26, 2025

The error was introduced in the PR #101895 on Linux when using the Stop button when the game is embedded. When using the Stop button the game process is killed and the window id becomes invalid. Even with the XSetErrorHandler(&bad_window_error_handler), the error is thrown on the next x11 call. Adding a little check to see if the window is still valid before executing the XSendEvent fixed the issue.

The error was:

INTERNAL ERROR: Unhandled XServer error: BadWindow (invalid Window parameter)
   Major opcode of failed request: 25
   Serial number of failed request: 0
   Current serial number in output stream: 8195764

CC @YeldhamDev

@Hilderin Hilderin requested a review from a team as a code owner January 26, 2025 01:35
@Hilderin Hilderin added this to the 4.4 milestone Jan 26, 2025
Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes it on my end, good job!

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue is reproducable on XWayland and is fixed.

@Repiteo Repiteo merged commit 4793965 into godotengine:master Jan 27, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 27, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants