Skip to content

Commit

Permalink
sdlwindow: Display app name and title for screen saver
Browse files Browse the repository at this point in the history
  • Loading branch information
detiam authored and misyltoad committed Feb 27, 2024
1 parent 441a0ba commit 701393d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sdlwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@ namespace gamescope

m_uUserEventIdBase = SDL_RegisterEvents( GAMESCOPE_SDL_EVENT_COUNT );

SDL_SetHint( SDL_HINT_APP_NAME, "Gamescope" );
SDL_SetHint( SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1" );

if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS ) != 0 )
{
m_eSDLInit = SDLInitState::SDLInit_Failure;
Expand Down Expand Up @@ -879,6 +882,10 @@ namespace gamescope
if ( g_bGrabbed )
szTitle += " (grabbed)";
SDL_SetWindowTitle( m_Connector.GetSDLWindow(), szTitle.c_str() );

szTitle = "Title: " + szTitle;
SDL_SetHint(SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME, szTitle.c_str() );
SDL_DisableScreenSaver();
}
else if ( event.type == GetUserEventIndex( GAMESCOPE_SDL_EVENT_ICON ) )
{
Expand Down

0 comments on commit 701393d

Please sign in to comment.