1
0
mirror of synced 2024-09-25 03:58:27 +02:00

fix: Disable multi window support on Linux by default as it causes issues

Fixes #1026
This commit is contained in:
WerWolv 2023-04-10 22:51:21 +02:00
parent 349b5da810
commit 013eaae715

View File

@ -883,12 +883,16 @@ namespace hex {
io.ConfigWindowsMoveFromTitleBarOnly = true; io.ConfigWindowsMoveFromTitleBarOnly = true;
io.FontGlobalScale = 1.0F; io.FontGlobalScale = 1.0F;
// Disable multi-window support on Wayland since it doesn't support it
if (glfwGetPrimaryMonitor() != nullptr) { if (glfwGetPrimaryMonitor() != nullptr) {
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE"); #if defined (OS_LINUX)
bool multiWindowEnabled = ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.multi_windows", 1) != 0; constexpr static auto MultiWindowSupportEnabledDefault = 0;
#else
constexpr static auto MultiWindowSupportEnabledDefault = 1;
#endif
if ((!sessionType || !hex::containsIgnoreCase(*sessionType, "wayland")) && multiWindowEnabled) bool multiWindowEnabled = ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.multi_windows", MultiWindowSupportEnabledDefault) != 0;
if (multiWindowEnabled)
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
} }