summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp5
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/setup_visual.cpp3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 7168f0cec..5dd417670 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -355,6 +355,11 @@ void Client::gameInit()
putenv("SDL_VIDEO_CENTERED=0");
#endif
+ if (config.getBoolValue("allowscreensaver"))
+ putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1");
+ else
+ putenv("SDL_VIDEO_ALLOW_SCREENSAVER=0");
+
chatLogger = new ChatLogger;
if (mOptions.chatLogDir == "")
chatLogger->setBaseLogDir(mLocalDataDir + std::string("/logs/"));
diff --git a/src/defaults.cpp b/src/defaults.cpp
index a020fbe1f..d29a818a7 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -267,6 +267,7 @@ DefaultsData* getConfigDefaults()
AddDEF("useAtlases", true);
AddDEF("useTextureSampler", false);
AddDEF("ministatussaved", 0);
+ AddDEF("allowscreensaver", false);
return configData;
}
diff --git a/src/gui/setup_visual.cpp b/src/gui/setup_visual.cpp
index a7d83b11d..7b35df3a1 100644
--- a/src/gui/setup_visual.cpp
+++ b/src/gui/setup_visual.cpp
@@ -111,6 +111,9 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) :
"", "centerwindow", this, "centerwindowEvent");
#endif
+ new SetupItemCheckBox(_("Allow screensaver to run"),
+ "", "allowscreensaver", this, "allowscreensaverEvent");
+
setDimension(gcn::Rectangle(0, 0, 550, 350));
}