Skip to content

Commit

Permalink
getWindowInfo: handle if the Wayland window handle is null
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiaholmquist committed Oct 18, 2022
1 parent ac3118c commit b6776bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/frontend/qt_sdl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,12 @@ std::optional<WindowInfo> ScreenPanelGL::getWindowInfo()
else if (platform_name == QStringLiteral("wayland"))
{
wi.type = WindowInfo::Type::Wayland;
wi.display_connection = pni->nativeResourceForWindow("display", windowHandle());
wi.window_handle = pni->nativeResourceForWindow("surface", windowHandle());
QWindow* handle = windowHandle();
if (handle == nullptr)
return std::nullopt;

wi.display_connection = pni->nativeResourceForWindow("display", handle);
wi.window_handle = pni->nativeResourceForWindow("surface", handle);
}
else
{
Expand Down

0 comments on commit b6776bd

Please sign in to comment.