_x11 fixes

This commit is contained in:
2025-01-11 11:50:36 +02:00
parent 3a04326bfd
commit 62d99b18cd

View File

@@ -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;
}