From b19a9bced6baf0f309e28463e3a4a946bb7412dd Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 30 Aug 2025 00:04:36 +0000 Subject: [PATCH] [gamemode] make option available on all nixes Signed-off-by: lizzie --- src/yuzu/main.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1b6c5941dd..c09697d3ed 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -424,10 +424,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan) #ifdef __unix__ SetupSigInterrupts(); #endif - -#ifdef __linux__ SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue()); -#endif UISettings::RestoreWindowState(config); @@ -3885,9 +3882,7 @@ void GMainWindow::OnConfigure() { const auto old_theme = UISettings::values.theme; const bool old_discord_presence = UISettings::values.enable_discord_presence.GetValue(); const auto old_language_index = Settings::values.language_index.GetValue(); -#ifdef __linux__ const bool old_gamemode = Settings::values.enable_gamemode.GetValue(); -#endif Settings::SetConfiguringGlobal(true); ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), @@ -3947,11 +3942,9 @@ void GMainWindow::OnConfigure() { if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) { SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue()); } -#ifdef __linux__ if (Settings::values.enable_gamemode.GetValue() != old_gamemode) { SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue()); } -#endif if (!multiplayer_state->IsHostingPublicRoom()) { multiplayer_state->UpdateCredentials(); @@ -5560,13 +5553,15 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { discord_rpc->Update(); } -#ifdef __linux__ void GMainWindow::SetGamemodeEnabled(bool state) { if (emulation_running) { - Common::Linux::SetGamemodeState(state); + if (state) { + Common::FeralGamemode::Start(); + } else { + Common::FeralGamemode::Stop(); + } } } -#endif void GMainWindow::changeEvent(QEvent* event) { #ifdef __unix__ @@ -5730,7 +5725,7 @@ int main(int argc, char* argv[]) { chdir(Common::FS::PathToUTF8String(bin_path).c_str()); #endif -#ifdef __linux__ +#ifdef __unix__ // Set the DISPLAY variable in order to open web browsers // TODO (lat9nq): Find a better solution for AppImages to start external applications if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) {