Add cross-platform "disable screen saver" setting (#497)

This commit is contained in:
lisa-wolfgang 2023-02-24 15:10:07 -06:00 committed by GitHub
parent 80b1c50b50
commit 4c697d3755
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 7 deletions

View file

@ -20,6 +20,7 @@
#include "util/helpers/helpers.h"
#include "config/CemuConfig.h"
#include "Cemu/DiscordPresence/DiscordPresence.h"
#include "util/ScreenSaver/ScreenSaver.h"
#include "gui/GeneralSettings2.h"
#include "gui/GraphicPacksWindow2.h"
#include "gui/GameProfileWindow.h"
@ -565,6 +566,14 @@ bool MainWindow::FileLoad(std::wstring fileName, wxLaunchGameEvent::INITIATED_BY
m_discord->UpdatePresence(DiscordPresence::Playing, m_launched_game_name);
#endif
if (GetConfig().disable_screensaver)
{
ScreenSaver::SetInhibit(true);
// TODO: disable when only the game, not Cemu, is closed (a feature not yet implemented)
// currently unnecessary because this will happen automatically when Cemu closes
// ScreenSaver::SetInhibit(false);
}
if (ActiveSettings::FullscreenEnabled())
SetFullScreen(true);