1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Crash when no monitors have been defined by the OS

This commit is contained in:
WerWolv 2022-06-03 10:35:05 +02:00
parent fadca9a34a
commit bf1441223c

View File

@ -653,8 +653,9 @@ namespace hex {
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_NavEnableKeyboard;
{
if (glfwGetPrimaryMonitor() != nullptr) {
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE");
if (!sessionType || !hex::containsIgnoreCase(*sessionType, "wayland"))
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
}