diff options
author | Aleix Pol <aleixpol@kde.org> | 2017-10-13 15:44:09 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-12-14 15:36:01 +0000 |
commit | 98f38b01997ec59aa5040f839deb6f062f01be17 (patch) | |
tree | 78a3dc7cefeb19ffd03273a4ac3b07fd12f2b4cc | |
parent | 61f92b6742c96f4974e23893ba6926e4d012cd09 (diff) |
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 <davidedmundson@kde.org>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r-- | src/client/qwaylandxdgshellv6.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<QWaylandXdgSurfaceV6 *>(transientParent->shellSurface()); - m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); + if (parentXdgSurface) + m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); } } } |