SDL window is invisible and unselectable in Wayland Fedora #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
SDL windows have a lot of trouble displaying properly in Wayland environments like Fedora, so much so that the SDL accesskit C-bindings example created an orphaned application that was unselectable and could not grab focus by the OS when running on Fedora 41 GNOME.
This causes the SDL example to fail, because its impossible to focus on the invisible buttons in the invisible window.
No matter what I tried, ORCA would not respond and focus on the buttons.
Sollution
By writing an all-black color to the Fill rect and updating the window surface with said rect, it forces the window to render. This also causes GNOME to render the window Decorator titled "hello world", which otherwise would not be rendered in this example.
This change also causes parity with the Windows OS example of accesskit and SDL, because the Windows example DOES create a black window containing the application example,
So this change is simply working around quirks and differences between the SDL handling of Windows, Linux Wayland and X11, and forces the app window to always be created.