Fix disable screensaver workaround (#728)

This commit is contained in:
goeiecool9999 2023-03-30 11:32:25 +02:00 committed by GitHub
parent b3180bc4a6
commit cb9570e229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 5 deletions

View File

@ -60,7 +60,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
did_show_macos_disclaimer = parser.get("macos_disclaimer", did_show_macos_disclaimer); did_show_macos_disclaimer = parser.get("macos_disclaimer", did_show_macos_disclaimer);
fullscreen = parser.get("fullscreen", fullscreen); fullscreen = parser.get("fullscreen", fullscreen);
proxy_server = parser.get("proxy_server", ""); proxy_server = parser.get("proxy_server", "");
disable_screensaver = parser.get("disable_screensaver", true); disable_screensaver = parser.get("disable_screensaver", disable_screensaver);
// cpu_mode = parser.get("cpu_mode", cpu_mode.GetInitValue()); // cpu_mode = parser.get("cpu_mode", cpu_mode.GetInitValue());
//console_region = parser.get("console_region", console_region.GetInitValue()); //console_region = parser.get("console_region", console_region.GetInitValue());

View File

@ -367,7 +367,15 @@ struct CemuConfig
ConfigValue<bool> fullscreen_menubar{ false }; ConfigValue<bool> fullscreen_menubar{ false };
ConfigValue<bool> fullscreen{ false }; ConfigValue<bool> fullscreen{ false };
ConfigValue<std::string> proxy_server{}; ConfigValue<std::string> proxy_server{};
ConfigValue<bool> disable_screensaver{true};
// temporary workaround because feature crashes on macOS
#if BOOST_OS_MACOS
#define DISABLE_SCREENSAVER_DEFAULT false
#else
#define DISABLE_SCREENSAVER_DEFAULT true
#endif
ConfigValue<bool> disable_screensaver{DISABLE_SCREENSAVER_DEFAULT};
#undef DISABLE_SCREENSAVER_DEFAULT
std::vector<std::wstring> game_paths; std::vector<std::wstring> game_paths;
std::mutex game_cache_entries_mutex; std::mutex game_cache_entries_mutex;

View File

@ -178,8 +178,9 @@ wxPanel* GeneralSettings2::AddGeneralPage(wxNotebook* notebook)
m_disable_screensaver = new wxCheckBox(box, wxID_ANY, _("Disable screen saver")); m_disable_screensaver = new wxCheckBox(box, wxID_ANY, _("Disable screen saver"));
m_disable_screensaver->SetToolTip(_("Prevents the system from activating the screen saver or going to sleep while running a game.")); m_disable_screensaver->SetToolTip(_("Prevents the system from activating the screen saver or going to sleep while running a game."));
second_row->Add(m_disable_screensaver, 0, botflag, 5); second_row->Add(m_disable_screensaver, 0, botflag, 5);
#ifdef BOOST_OS_MACOS
m_disable_screensaver->SetValue(false); // temporary workaround because feature crashes on macOS
#if BOOST_OS_MACOS
m_disable_screensaver->Enable(false); m_disable_screensaver->Enable(false);
#endif #endif
@ -1507,6 +1508,10 @@ void GeneralSettings2::ApplyConfig()
m_permanent_storage->SetValue(config.permanent_storage); m_permanent_storage->SetValue(config.permanent_storage);
m_disable_screensaver->SetValue(config.disable_screensaver); m_disable_screensaver->SetValue(config.disable_screensaver);
// temporary workaround because feature crashes on macOS
#if BOOST_OS_MACOS
m_disable_screensaver->SetValue(false);
#endif
for (auto& path : config.game_paths) for (auto& path : config.game_paths)
{ {

View File

@ -6,7 +6,8 @@ class ScreenSaver
public: public:
static void SetInhibit(bool inhibit) static void SetInhibit(bool inhibit)
{ {
#ifdef BOOST_OS_MACOS // temporary workaround because feature crashes on macOS
#if BOOST_OS_MACOS
return; return;
#endif #endif
// Initialize video subsystem if necessary // Initialize video subsystem if necessary