Set SDL_HINT_APP_NAME
for tiles
#79125
Open
+7
−0
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.
Summary
None
Purpose of change
Make SDL properly identify the game. Specifically, under Linux, identify CDDA when requesting the screensaver inhibited via dbus (since SDL inhibits screensaver by default since 2.0.2, CDDA currently does this without providing a name, so it shows up as "My SDL application"), and identify CDDA under audio mixers.
I encountered this, because the power management widget under KDE Plasma kept telling me "My SDL Application" is blocking sleep and screen locking.
Describe the solution
Under SDL2, this can be done with
SDL_APP_NAME
, as documented by SDL. This appears to be best set beforeSDL_Init()
.Describe alternatives you've considered
This could be gated to Linux, as it does not seem to affect other platforms, but SDL documentation indicates that on platforms where it's unsupported, it does nothing.
It could also reuse the window title, but in the contexts it appears, it's better without the version string.
Testing
Built CDDA with the changes, and verified that the name shows up where it should.
Additional context
Plasma power widget showing name:
Plasma volume slider with the name: