diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2022-10-19 00:03:28 +0200 |
---|---|---|
committer | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2022-10-19 00:03:28 +0200 |
commit | b6776bd826fbe31c62a7222d34cf387fb6f3d260 (patch) | |
tree | 81286d059c05de652c6aeb78b66ea9997a74dea1 /src/frontend/qt_sdl/main.cpp | |
parent | ac3118cbc54715da55856958b42817fbd1eed666 (diff) |
getWindowInfo: handle if the Wayland window handle is null
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index cd0ea52..bea8c6d 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -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 { |