diff --git a/src/Backend/Window/SDL/BackendSDL.cpp b/src/Backend/Window/SDL/BackendSDL.cpp index 262883704..9d236dcfc 100644 --- a/src/Backend/Window/SDL/BackendSDL.cpp +++ b/src/Backend/Window/SDL/BackendSDL.cpp @@ -398,8 +398,9 @@ namespace tgui if (!m_mouseCursors[type]) // Only bypass SDL when system cursors are used { #if SDL_MAJOR_VERSION >= 3 - Display* displayX11 = reinterpret_cast(SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.x11.display")); - Window windowX11 = reinterpret_cast(SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.x11.window")); + const SDL_PropertiesID windowProps = SDL_GetWindowProperties(window); + const Window windowX11 = static_cast(SDL_GetNumberProperty(windowProps, "SDL.window.x11.window", 0)); + Display* displayX11 = reinterpret_cast(SDL_GetProperty(windowProps, "SDL.window.x11.display", nullptr)); #else Display* displayX11 = nullptr; Window windowX11 = 0;