[gamemode] make option available on all nixes
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
f51e28c00a
commit
47a3308f92
1 changed files with 8 additions and 11 deletions
|
@ -416,10 +416,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
|
|||
#ifdef __unix__
|
||||
SetupSigInterrupts();
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
|
||||
#endif
|
||||
|
||||
UISettings::RestoreWindowState(config);
|
||||
|
||||
|
@ -3408,9 +3405,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(),
|
||||
|
@ -3470,11 +3465,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();
|
||||
|
@ -4761,13 +4754,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__
|
||||
|
@ -4927,7 +4922,9 @@ int main(int argc, char* argv[]) {
|
|||
// the user folder in the Qt Frontend, we need to cd into that working directory
|
||||
const auto bin_path = Common::FS::GetBundleDirectory() / "..";
|
||||
chdir(Common::FS::PathToUTF8String(bin_path).c_str());
|
||||
#elif defined(__unix__) && !defined(__ANDROID__)
|
||||
#endif
|
||||
|
||||
#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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue