diff --git a/app/streaming/streamutils.cpp b/app/streaming/streamutils.cpp index b8ca4aef..dde5f704 100644 --- a/app/streaming/streamutils.cpp +++ b/app/streaming/streamutils.cpp @@ -87,15 +87,30 @@ Uint32 StreamUtils::getPlatformWindowFlags() SDL_Window* StreamUtils::createTestWindow() { SDL_Window* testWindow; + Uint32 baseFlags = 0; + // Test windows are always hidden + baseFlags |= SDL_WINDOW_HIDDEN; + + // Creating a Vulkan surface with KMSDRM requires finding a display mode + // that exactly matches the window size. This is not always possible, + // particularly with drivers (Nvidia) that only expose modes matching + // the current resolution (only differing by refresh rate). Fullscreen + // desktop mode ensures the window size exactly matches the display mode + // which prevents false Vulkan renderer failures during decoder probing. + if (QString(SDL_GetCurrentVideoDriver()) == "KMSDRM") { + baseFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + + // Try to add the platform-specific flags first and fall back if that fails testWindow = SDL_CreateWindow("", 0, 0, 1280, 720, - SDL_WINDOW_HIDDEN | StreamUtils::getPlatformWindowFlags()); + baseFlags | StreamUtils::getPlatformWindowFlags()); if (!testWindow) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Failed to create test window with platform flags: %s", SDL_GetError()); - testWindow = SDL_CreateWindow("", 0, 0, 1280, 720, SDL_WINDOW_HIDDEN); + testWindow = SDL_CreateWindow("", 0, 0, 1280, 720, baseFlags); if (!testWindow) { return nullptr; }