From 98f38b01997ec59aa5040f839deb6f062f01be17 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 13 Oct 2017 15:44:09 +0200 Subject: Fix crash when opening a window with a hidden parent We have a transient parent but it doesn't have a shell surface. We need to make sure that it exists before setting the transient parent's shell surface as the parent to the window. Change-Id: I918b2f14074217638529ba73530f0102f7438079 Reviewed-by: David Edmundson Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandxdgshellv6.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index cd81778c7..d9302ed57 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -169,7 +169,8 @@ void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transien setToplevel(); if (transientParent) { auto parentXdgSurface = static_cast(transientParent->shellSurface()); - m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); + if (parentXdgSurface) + m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); } } } -- cgit v1.2.3