Skip to content

Commit b8e7775

Browse files
committed
identify the game by its name in SDL
1 parent ad87861 commit b8e7775

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/engine/client/ClientApplication.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ class ClientApplication : public Application {
8585
// Don't set this for TTY applications as they really aren't DPI aware. Let them scale.
8686
SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "system");
8787
#endif
88+
89+
#if defined(__linux__) && defined(BUILD_GRAPHICAL_CLIENT)
90+
// identify the game by its name in certain
91+
// volume control / power control applets,
92+
// for example, the one found on KDE:
93+
// "Unvanquished is currently blocking sleep."
94+
// instead of "My SDL application ..."
95+
// this feature was introduced in SDL 2.0.22
96+
SDL_SetHint("SDL_APP_NAME", PRODUCT_NAME);
97+
// SDL_hints.h: #define SDL_HINT_APP_NAME "SDL_APP_NAME"
98+
// don't use the macro here, in case
99+
// SDL doesn't use current headers.
100+
#endif
101+
88102
Hunk_Init();
89103

90104
Com_Init();

0 commit comments

Comments
 (0)