From dfa56765d6d869a317ec46dcf3a8f4f35b146382 Mon Sep 17 00:00:00 2001 From: xcfrg <30675315+xcfrg@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:45:33 -0400 Subject: yuzu: integrate gamemode support on linux --- src/common/settings.h | 2 + src/yuzu/CMakeLists.txt | 2 +- src/yuzu/configuration/configure_general.cpp | 3 ++ src/yuzu/configuration/shared_translation.cpp | 1 + src/yuzu/main.cpp | 54 +++++++++++++++++++++++++++ src/yuzu/uisettings.h | 3 ++ src/yuzu_cmd/CMakeLists.txt | 1 + src/yuzu_cmd/yuzu.cpp | 24 ++++++++++++ 8 files changed, 89 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common/settings.h b/src/common/settings.h index e75099b89..788020bde 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -178,6 +178,8 @@ struct Values { true, &use_speed_limit}; + Setting enable_gamemode{linkage, false, "enable_gamemode", Category::Core}; + // Cpu SwitchableSetting cpu_accuracy{linkage, CpuAccuracy::Auto, CpuAccuracy::Auto, CpuAccuracy::Paranoid, diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 90278052a..f3ad2214b 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -386,7 +386,7 @@ if (NOT WIN32) target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) endif() if (UNIX AND NOT APPLE) - target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus) + target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus gamemode) endif() target_compile_definitions(yuzu PRIVATE diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index c727fadd1..ce7e17850 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -29,6 +29,9 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_, if (!Settings::IsConfiguringGlobal()) { ui->button_reset_defaults->setVisible(false); } +#ifndef __linux__ + ui->enable_gamemode->setVisible(false); +#endif } ConfigureGeneral::~ConfigureGeneral() = default; diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index a7b5def32..903805e75 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp @@ -175,6 +175,7 @@ std::unique_ptr InitializeTranslations(QWidget* parent) { INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"), QStringLiteral()); INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"), QStringLiteral()); + INSERT(UISettings, enable_gamemode, tr("Enable Gamemode"), QStringLiteral()); // Ui Debugging diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index defe45198..cf61d4258 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -185,6 +185,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif +#ifdef __linux__ +#include +#endif + constexpr int default_mouse_hide_timeout = 2500; constexpr int default_mouse_center_timeout = 10; constexpr int default_input_update_timeout = 1; @@ -2126,6 +2130,16 @@ void GMainWindow::OnEmulationStopped() { discord_rpc->Update(); +#ifdef __linux__ + if (UISettings::values.enable_gamemode) { + if (gamemode_request_end() < 0) { + LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Stopped gamemode"); + } + } +#endif + // The emulation is stopped, so closing the window or not does not matter anymore disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame); @@ -3504,6 +3518,16 @@ void GMainWindow::OnStartGame() { play_time_manager->Start(); discord_rpc->Update(); + +#ifdef __linux__ + if (UISettings::values.enable_gamemode) { + if (gamemode_request_start() < 0) { + LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Started gamemode"); + } + } +#endif } void GMainWindow::OnRestartGame() { @@ -3524,6 +3548,16 @@ void GMainWindow::OnPauseGame() { play_time_manager->Stop(); UpdateMenuState(); AllowOSSleep(); + +#ifdef __linux__ + if (UISettings::values.enable_gamemode) { + if (gamemode_request_end() < 0) { + LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Stopped gamemode"); + } + } +#endif } void GMainWindow::OnPauseContinueGame() { @@ -5181,6 +5215,26 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { discord_rpc->Update(); } +void GMainWindow::SetGamemodeDisabled([[maybe_unused]] bool state) { +#ifdef __linux__ + if (emulation_running) { + if (state) { + if (gamemode_request_end() < 0) { + LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Stopped gamemode"); + } + } else { + if (gamemode_request_start() < 0) { + LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Started gamemode"); + } + } + } +#endif +} + void GMainWindow::changeEvent(QEvent* event) { #ifdef __unix__ // PaletteChange event appears to only reach so far into the GUI, explicitly asking to diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 549a39e1b..3e5ddc07a 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -140,6 +140,9 @@ struct Values { Settings::Specialization::Default, true, true}; + // Gamemode + Setting enable_gamemode{linkage, false, "enable_gamemode", Category::UiGeneral}; + Setting disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; // Discord RPC diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index fbeba8813..002f3e841 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -44,6 +44,7 @@ target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers) if(UNIX AND NOT APPLE) install(TARGETS yuzu-cmd) + target_link_libraries(yuzu-cmd PRIVATE gamemode) endif() if(WIN32) diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 0416d5951..1c3a1809b 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -63,6 +63,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif +#ifdef __linux__ +#include +#endif + static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \n" @@ -425,6 +429,16 @@ int main(int argc, char** argv) { exit(0); }); +#ifdef __linux__ + if (Settings::values.disable_gamemode) { + if (gamemode_request_start() < 0) { + LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Started gamemode"); + } + } +#endif + void(system.Run()); if (system.DebuggerEnabled()) { system.InitializeDebugger(); @@ -436,6 +450,16 @@ int main(int argc, char** argv) { void(system.Pause()); system.ShutdownMainProcess(); +#ifdef __linux__ + if (Settings::values.disable_gamemode) { + if (gamemode_request_end() < 0) { + LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Stopped gamemode"); + } + } +#endif + detached_tasks.WaitForAllTasks(); return 0; } -- cgit v1.2.3 From 40644d43f700cb0075db0eea288078bda7cf4527 Mon Sep 17 00:00:00 2001 From: flodavid Date: Fri, 3 Nov 2023 15:41:16 +0100 Subject: yuzu: create linux group in general settings - Create files dedicated to starting and stopping gamemode functions - Use them in yuzu and yuzu_cmd modules --- src/common/CMakeLists.txt | 9 ++++ src/common/linux/gamemode.cpp | 39 ++++++++++++++++ src/common/linux/gamemode.h | 24 ++++++++++ src/common/settings.cpp | 2 + src/common/settings.h | 5 ++- src/common/settings_common.h | 1 + src/yuzu/configuration/configure_general.cpp | 46 ++++++++++++++----- src/yuzu/configuration/configure_general.ui | 27 +++++++++++ src/yuzu/configuration/configure_system.ui | 2 +- src/yuzu/configuration/shared_translation.cpp | 4 +- src/yuzu/main.cpp | 64 +++++++++------------------ src/yuzu/main.h | 1 + src/yuzu/uisettings.h | 3 -- src/yuzu_cmd/yuzu.cpp | 24 +++------- 14 files changed, 172 insertions(+), 79 deletions(-) create mode 100644 src/common/linux/gamemode.cpp create mode 100644 src/common/linux/gamemode.h (limited to 'src') diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index e216eb3de..57cbb9d07 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -174,6 +174,15 @@ if(ANDROID) ) endif() +if (UNIX) + target_sources(common PRIVATE + linux/gamemode.cpp + linux/gamemode.h + ) + + target_link_libraries(common PRIVATE gamemode) +endif() + if(ARCHITECTURE_x86_64) target_sources(common PRIVATE diff --git a/src/common/linux/gamemode.cpp b/src/common/linux/gamemode.cpp new file mode 100644 index 000000000..8876d8dc4 --- /dev/null +++ b/src/common/linux/gamemode.cpp @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include "common/linux/gamemode.h" +#include "common/settings.h" + +namespace Common::Linux { + +void StartGamemode() { + if (Settings::values.enable_gamemode) { + if (gamemode_request_start() < 0) { + LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Started gamemode"); + } + } +} + +void StopGamemode() { + if (Settings::values.enable_gamemode) { + if (gamemode_request_end() < 0) { + LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); + } else { + LOG_INFO(Frontend, "Stopped gamemode"); + } + } +} + +void SetGamemodeState(bool state) { + if (state) { + StartGamemode(); + } else { + StopGamemode(); + } +} + +} // namespace Common::Linux diff --git a/src/common/linux/gamemode.h b/src/common/linux/gamemode.h new file mode 100644 index 000000000..b80646ae2 --- /dev/null +++ b/src/common/linux/gamemode.h @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +namespace Common::Linux { + +/** + * Start the (Feral Interactive) Linux gamemode if it is installed and it is activated + */ +void StartGamemode(); + +/** + * Stop the (Feral Interactive) Linux gamemode if it is installed and it is activated + */ +void StopGamemode(); + +/** + * Start or stop the (Feral Interactive) Linux gamemode if it is installed and it is activated + * @param state The new state the gamemode should have + */ +void SetGamemodeState(bool state); + +} // namespace Common::Linux diff --git a/src/common/settings.cpp b/src/common/settings.cpp index a10131eb2..3e829253f 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -219,6 +219,8 @@ const char* TranslateCategory(Category category) { return "Services"; case Category::Paths: return "Paths"; + case Category::Linux: + return "Linux"; case Category::MaxEnum: break; } diff --git a/src/common/settings.h b/src/common/settings.h index 788020bde..491f0d3e0 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -178,8 +178,6 @@ struct Values { true, &use_speed_limit}; - Setting enable_gamemode{linkage, false, "enable_gamemode", Category::Core}; - // Cpu SwitchableSetting cpu_accuracy{linkage, CpuAccuracy::Auto, CpuAccuracy::Auto, CpuAccuracy::Paranoid, @@ -429,6 +427,9 @@ struct Values { true, true}; + // Linux + SwitchableSetting enable_gamemode{linkage, true, "enable_gamemode", Category::Linux}; + // Controls InputSetting> players; diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 7943223eb..344c04439 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h @@ -41,6 +41,7 @@ enum class Category : u32 { Multiplayer, Services, Paths, + Linux, MaxEnum, }; diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index ce7e17850..701b895e7 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -29,9 +29,6 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_, if (!Settings::IsConfiguringGlobal()) { ui->button_reset_defaults->setVisible(false); } -#ifndef __linux__ - ui->enable_gamemode->setVisible(false); -#endif } ConfigureGeneral::~ConfigureGeneral() = default; @@ -39,12 +36,29 @@ ConfigureGeneral::~ConfigureGeneral() = default; void ConfigureGeneral::SetConfiguration() {} void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) { - QLayout& layout = *ui->general_widget->layout(); + QLayout& general_layout = *ui->general_widget->layout(); + QLayout& linux_layout = *ui->linux_widget->layout(); + + std::map general_hold{}; + std::map linux_hold{}; + + std::vector settings; + + auto push = [&settings](auto& list) { + for (auto setting : list) { + settings.push_back(setting); + } + }; - std::map hold{}; + push(UISettings::values.linkage.by_category[Settings::Category::UiGeneral]); + push(Settings::values.linkage.by_category[Settings::Category::Linux]); - for (const auto setting : - UISettings::values.linkage.by_category[Settings::Category::UiGeneral]) { + // Only show Linux group on Unix +#ifndef __unix__ + ui->LinuxGroupBox->setVisible(false); +#endif + + for (const auto setting : settings) { auto* widget = builder.BuildWidget(setting, apply_funcs); if (widget == nullptr) { @@ -55,11 +69,23 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) { continue; } - hold.emplace(setting->Id(), widget); + switch (setting->GetCategory()) { + case Settings::Category::UiGeneral: + general_hold.emplace(setting->Id(), widget); + break; + case Settings::Category::Linux: + linux_hold.emplace(setting->Id(), widget); + break; + default: + widget->deleteLater(); + } } - for (const auto& [id, widget] : hold) { - layout.addWidget(widget); + for (const auto& [id, widget] : general_hold) { + general_layout.addWidget(widget); + } + for (const auto& [id, widget] : linux_hold) { + linux_layout.addWidget(widget); } } diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index a10e7d3a5..ef20891a3 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -46,6 +46,33 @@ + + + + Linux + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui index 2a735836e..04b771129 100644 --- a/src/yuzu/configuration/configure_system.ui +++ b/src/yuzu/configuration/configure_system.ui @@ -57,7 +57,7 @@ - + Core diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index 903805e75..ee0ca4aa7 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp @@ -175,7 +175,9 @@ std::unique_ptr InitializeTranslations(QWidget* parent) { INSERT(UISettings, hide_mouse, tr("Hide mouse on inactivity"), QStringLiteral()); INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"), QStringLiteral()); - INSERT(UISettings, enable_gamemode, tr("Enable Gamemode"), QStringLiteral()); + + // Linux + INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QStringLiteral()); // Ui Debugging diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index cf61d4258..6ef518b6a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -17,6 +17,7 @@ #ifdef __unix__ #include #include +#include "common/linux/gamemode.h" #endif #include @@ -185,10 +186,6 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif -#ifdef __linux__ -#include -#endif - constexpr int default_mouse_hide_timeout = 2500; constexpr int default_mouse_center_timeout = 10; constexpr int default_input_update_timeout = 1; @@ -323,6 +320,7 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk provider{std::make_unique()} { #ifdef __unix__ SetupSigInterrupts(); + SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue()); #endif system->Initialize(); @@ -2130,14 +2128,8 @@ void GMainWindow::OnEmulationStopped() { discord_rpc->Update(); -#ifdef __linux__ - if (UISettings::values.enable_gamemode) { - if (gamemode_request_end() < 0) { - LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Stopped gamemode"); - } - } +#ifdef __unix__ + Common::Linux::StopGamemode(); #endif // The emulation is stopped, so closing the window or not does not matter anymore @@ -3519,14 +3511,8 @@ void GMainWindow::OnStartGame() { discord_rpc->Update(); -#ifdef __linux__ - if (UISettings::values.enable_gamemode) { - if (gamemode_request_start() < 0) { - LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Started gamemode"); - } - } +#ifdef __unix__ + Common::Linux::StartGamemode(); #endif } @@ -3549,14 +3535,8 @@ void GMainWindow::OnPauseGame() { UpdateMenuState(); AllowOSSleep(); -#ifdef __linux__ - if (UISettings::values.enable_gamemode) { - if (gamemode_request_end() < 0) { - LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Stopped gamemode"); - } - } +#ifdef __unix__ + Common::Linux::StopGamemode(); #endif } @@ -3839,6 +3819,9 @@ 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 __unix__ + const bool old_gamemode = Settings::values.enable_gamemode.GetValue(); +#endif Settings::SetConfiguringGlobal(true); ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), @@ -3900,6 +3883,11 @@ void GMainWindow::OnConfigure() { if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) { SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue()); } +#ifdef __unix__ + if (Settings::values.enable_gamemode.GetValue() != old_gamemode) { + SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue()); + } +#endif if (!multiplayer_state->IsHostingPublicRoom()) { multiplayer_state->UpdateCredentials(); @@ -5215,25 +5203,13 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { discord_rpc->Update(); } -void GMainWindow::SetGamemodeDisabled([[maybe_unused]] bool state) { -#ifdef __linux__ +#ifdef __unix__ +void GMainWindow::SetGamemodeEnabled(bool state) { if (emulation_running) { - if (state) { - if (gamemode_request_end() < 0) { - LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Stopped gamemode"); - } - } else { - if (gamemode_request_start() < 0) { - LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Started gamemode"); - } - } + Common::Linux::SetGamemodeState(state); } -#endif } +#endif void GMainWindow::changeEvent(QEvent* event) { #ifdef __unix__ diff --git a/src/yuzu/main.h b/src/yuzu/main.h index c989c079d..2e13e1834 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -340,6 +340,7 @@ private: void SetupSigInterrupts(); static void HandleSigInterrupt(int); void OnSigInterruptNotifierActivated(); + void SetGamemodeEnabled(bool state); #endif private slots: diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 3e5ddc07a..549a39e1b 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -140,9 +140,6 @@ struct Values { Settings::Specialization::Default, true, true}; - // Gamemode - Setting enable_gamemode{linkage, false, "enable_gamemode", Category::UiGeneral}; - Setting disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; // Discord RPC diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 1c3a1809b..a81635fa4 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -63,8 +63,8 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif -#ifdef __linux__ -#include +#ifdef __unix__ +#include "common/linux/gamemode.h" #endif static void PrintHelp(const char* argv0) { @@ -429,14 +429,8 @@ int main(int argc, char** argv) { exit(0); }); -#ifdef __linux__ - if (Settings::values.disable_gamemode) { - if (gamemode_request_start() < 0) { - LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Started gamemode"); - } - } +#ifdef __unix__ + Common::Linux::StartGamemode(); #endif void(system.Run()); @@ -450,14 +444,8 @@ int main(int argc, char** argv) { void(system.Pause()); system.ShutdownMainProcess(); -#ifdef __linux__ - if (Settings::values.disable_gamemode) { - if (gamemode_request_end() < 0) { - LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string()); - } else { - LOG_INFO(Frontend, "Stopped gamemode"); - } - } +#ifdef __unix__ + Common::Linux::StopGamemode(); #endif detached_tasks.WaitForAllTasks(); -- cgit v1.2.3 From ac11f6e4c5da64db5a6fb2647afbb85164f06086 Mon Sep 17 00:00:00 2001 From: flodavid Date: Fri, 3 Nov 2023 15:57:43 +0100 Subject: cmake: move gamemode target include into its file --- src/yuzu_cmd/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 002f3e841..fbeba8813 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -44,7 +44,6 @@ target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers) if(UNIX AND NOT APPLE) install(TARGETS yuzu-cmd) - target_link_libraries(yuzu-cmd PRIVATE gamemode) endif() if(WIN32) -- cgit v1.2.3