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

Set SDL_HINT_APP_NAME for tiles #79125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeeUnderscore
Copy link
Contributor

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 before SDL_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:
screenshot of widget

Plasma volume slider with the name:
screenshot of the audio widget

@github-actions github-actions bot added the [C++] Changes (can be) made in C++. Previously named `Code` label Jan 13, 2025
@DeeUnderscore
Copy link
Contributor Author

Whoops, noticed some spurious whitespace in the diff.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant