mirror of
https://github.com/simh/simh.git
synced 2026-04-19 01:17:28 +00:00
VIDEO: Provide a user configurable option to enable the screen saver
The environment variable SDL_VIDEO_ALLOW_SCREENSAVER can override the default that disables the OS screen saver if a video window is displayed by the simulator. sim> set env SDL_VIDEO_ALLOW_SCREENSAVER=1
This commit is contained in:
21
sim_video.c
21
sim_video.c
@@ -1964,11 +1964,24 @@ if (!initialized) {
|
|||||||
eventtypes[SDL_USEREVENT] = "USEREVENT";
|
eventtypes[SDL_USEREVENT] = "USEREVENT";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For consistency with behavior since SDL 2.0.2, we disable
|
* The SDL_HINT_VIDEO_ALLOW_SCREENSAVER at init time enables
|
||||||
* the screen saver when a video display is enabled.
|
* the screensaver. Once a video window is created, we default
|
||||||
|
* to being consistent with behavior since SDL 2.0.2 and we disable
|
||||||
|
* the screen saver.
|
||||||
|
*
|
||||||
|
* We allow an environment variable SDL_VIDEO_ALLOW_SCREENSAVER
|
||||||
|
* to specifically change this to enable the screensaver if the
|
||||||
|
* value is "1".
|
||||||
*/
|
*/
|
||||||
if (SDL_IsScreenSaverEnabled () == SDL_TRUE)
|
if ((getenv ("SDL_VIDEO_ALLOW_SCREENSAVER") == NULL) ||
|
||||||
SDL_DisableScreenSaver ();
|
(strcmp (getenv ("SDL_VIDEO_ALLOW_SCREENSAVER"), "1") != 0)) {
|
||||||
|
if (SDL_IsScreenSaverEnabled () == SDL_TRUE)
|
||||||
|
SDL_DisableScreenSaver ();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (SDL_IsScreenSaverEnabled () == SDL_FALSE)
|
||||||
|
SDL_EnableScreenSaver ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sim_debug (SIM_VID_DBG_VIDEO|SIM_VID_DBG_KEY|SIM_VID_DBG_MOUSE, vptr0->vid_dev, "vid_thread() - Starting\n");
|
sim_debug (SIM_VID_DBG_VIDEO|SIM_VID_DBG_KEY|SIM_VID_DBG_MOUSE, vptr0->vid_dev, "vid_thread() - Starting\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user