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.
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