summaryrefslogtreecommitdiff
path: root/src/utils/sdlhelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/sdlhelper.cpp')
-rw-r--r--src/utils/sdlhelper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp
index 85606f7f7..e30bdebaa 100644
--- a/src/utils/sdlhelper.cpp
+++ b/src/utils/sdlhelper.cpp
@@ -25,6 +25,7 @@
#include "logger.h"
#include "utils/cast.h"
+#include "utils/env.h"
#include "utils/stringutils.h"
#if defined(USE_X11) && defined(USE_OPENGL)
@@ -205,4 +206,12 @@ bool SDL::PollEvent(SDL_Event *event)
SDL_ALLEVENTS) > 0;
}
+void SDL::allowScreenSaver(const bool allow)
+{
+ if (allow)
+ setEnv("SDL_VIDEO_ALLOW_SCREENSAVER", "1");
+ else
+ setEnv("SDL_VIDEO_ALLOW_SCREENSAVER", "0");
+}
+
#endif // USE_SDL2