1
0
mirror of https://github.com/simh/simh.git synced 2026-02-06 00:15:40 +00:00

VIDEO: Avoid disabling screen saver until a video display is active

This commit is contained in:
Mark Pizzolato
2022-07-15 07:37:17 -10:00
parent 6f4d97f045
commit 8da65638df
2 changed files with 10 additions and 0 deletions

View File

@@ -509,6 +509,7 @@ main_argc = argc;
main_argv = argv;
SDL_SetHint (SDL_HINT_RENDER_DRIVER, "software");
SDL_SetHint (SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
status = SDL_Init (SDL_INIT_VIDEO);
@@ -1961,6 +1962,13 @@ if (!initialized) {
* and should be allocated with SDL_RegisterEvents()
*/
eventtypes[SDL_USEREVENT] = "USEREVENT";
/**
* For consistency with behavior since SDL 2.0.2, we disable
* the screen saver when a video display is enabled.
*/
if (SDL_IsScreenSaverEnabled () == SDL_TRUE)
SDL_DisableScreenSaver ();
}
sim_debug (SIM_VID_DBG_VIDEO|SIM_VID_DBG_KEY|SIM_VID_DBG_MOUSE, vptr0->vid_dev, "vid_thread() - Starting\n");