From 62d99b18cdc9dc53edda0cbf2b38f8e164b1ef1a Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sat, 11 Jan 2025 11:50:36 +0200 Subject: [PATCH] _x11 fixes --- Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp index 082e8868d..627bf4cb1 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp @@ -1602,6 +1602,11 @@ void SDLPlatform::SetHighDpiAwarenessEnabled(bool enable) bool SDLPlatform::UsesWayland() { + if (xDisplay == nullptr && WaylandDisplay == nullptr) + { + // In case the X11 display pointer has not been updated yet + return strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0; + } return WaylandDisplay != nullptr; } @@ -1617,6 +1622,11 @@ bool SDLPlatform::UsesXWayland() bool SDLPlatform::UsesX11() { + if (xDisplay == nullptr && WaylandDisplay == nullptr) + { + // In case the X11 display pointer has not been updated yet + return strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0; + } return xDisplay != nullptr; }