getWindowInfo: handle if the Wayland window handle is null

This commit is contained in:
Nadia Holmquist Pedersen 2022-10-19 00:03:28 +02:00
parent ac3118cbc5
commit b6776bd826
1 changed files with 6 additions and 2 deletions

View File

@ -1325,8 +1325,12 @@ std::optional<WindowInfo> ScreenPanelGL::getWindowInfo()
else if (platform_name == QStringLiteral("wayland")) else if (platform_name == QStringLiteral("wayland"))
{ {
wi.type = WindowInfo::Type::Wayland; wi.type = WindowInfo::Type::Wayland;
wi.display_connection = pni->nativeResourceForWindow("display", windowHandle()); QWindow* handle = windowHandle();
wi.window_handle = pni->nativeResourceForWindow("surface", windowHandle()); if (handle == nullptr)
return std::nullopt;
wi.display_connection = pni->nativeResourceForWindow("display", handle);
wi.window_handle = pni->nativeResourceForWindow("surface", handle);
} }
else else
{ {