Browse Source
[meta] Add option to FORCE X11 as Graphics Backend (#2820)
[meta] Add option to FORCE X11 as Graphics Backend (#2820)
* save the option on a external file because settings are loaded AFTER Qt window is created and then the graphics backend is already applied Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2820 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>pull/2892/head
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
7 changed files with 119 additions and 0 deletions
-
4src/common/settings.h
-
4src/qt_common/CMakeLists.txt
-
4src/qt_common/config/shared_translation.cpp
-
25src/qt_common/gui_settings.cpp
-
15src/qt_common/gui_settings.h
-
64src/yuzu/main.cpp
-
3src/yuzu/main.h
@ -0,0 +1,25 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|||
|
|||
#include "gui_settings.h"
|
|||
#include "common/fs/fs.h"
|
|||
#include "common/fs/path_util.h"
|
|||
|
|||
namespace FS = Common::FS; |
|||
|
|||
namespace GraphicsBackend { |
|||
|
|||
QString GuiConfigPath() { |
|||
return QString::fromStdString(FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "gui_config.ini")); |
|||
} |
|||
|
|||
void SetForceX11(bool state) { |
|||
(void)FS::CreateParentDir(GuiConfigPath().toStdString()); |
|||
QSettings(GuiConfigPath(), QSettings::IniFormat).setValue("gui_force_x11", state); |
|||
} |
|||
|
|||
bool GetForceX11() { |
|||
return QSettings(GuiConfigPath(), QSettings::IniFormat).value("gui_force_x11", false).toBool(); |
|||
} |
|||
|
|||
} // namespace GraphicsBackend
|
|||
@ -0,0 +1,15 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include <QSettings> |
|||
#include <QString> |
|||
|
|||
namespace GraphicsBackend { |
|||
|
|||
QString GuiConfigPath(); |
|||
void SetForceX11(bool state); |
|||
bool GetForceX11(); |
|||
|
|||
} // namespace GraphicsBackend |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue