summaryrefslogtreecommitdiff
path: root/src/utils/sdlhelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-13 01:57:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-13 01:57:39 +0300
commit10f73a88a374a250d192b02d783b5de3fe6e4aa6 (patch)
treebc7168fc5fbeeb68470d4245c7319c5a1098b554 /src/utils/sdlhelper.cpp
parent1f71a98b9377324bb08ba20fbfe52cbff67c49c9 (diff)
downloadplus-10f73a88a374a250d192b02d783b5de3fe6e4aa6.tar.gz
plus-10f73a88a374a250d192b02d783b5de3fe6e4aa6.tar.bz2
plus-10f73a88a374a250d192b02d783b5de3fe6e4aa6.tar.xz
plus-10f73a88a374a250d192b02d783b5de3fe6e4aa6.zip
Fix option for enable/disable screensaver in SDL 2.
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