Skip to content

Conversation

@TheDaChicken
Copy link

@TheDaChicken TheDaChicken commented Oct 24, 2025

Description

This adds a SDL_SetPreferredTheme function which allows user to "hint" at what theme they would want. SDL_GetSystemTheme() still needs to be called to determine if that theme was properly set.

I reworked how System Theme is worked on Windows. This is because user32.dll is already loaded and doesn't need to be constantly loaded per call of SDL_SetPreferredTheme etc. Also ShouldAppsUseDarkMode() isn't valid anymore after Window 10 1903+ according to here: mintty/mintty#983. The method of using registry key seems to work even on latest version of windows. That might be the best option.

This currently works on Windows since that is what I have experience with. If anyone has any tips for documentation and testing for other OSes let me know. SDL_Tray is also not updated based on preferred theme currently. This is only a draft and reference.

Existing Issue(s)

#13873

- Windows only currently with SDL_Tray not updated based on preferred theme
@TheDaChicken TheDaChicken marked this pull request as draft October 24, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant