Check whether m_toplevel exists before dereferencing it
The parent surface could be a popup. In that case m_toplevel would be nullptr. Since xdgshell doesn't allow an xdg_popup to be the parent of an xdg_toplevel, the best we can do is pretend there is no parent in this case. Fixes: QTBUG-130128 Pick-to: 6.8 Change-Id: Ib0367429b71ee96cbd1c3119e77769c511370624 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
This commit is contained in:
parent
ac879a0200
commit
43d385e949
@ -34,8 +34,8 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface)
|
||||
requestWindowStates(window->windowStates());
|
||||
requestWindowFlags(window->flags());
|
||||
if (auto transientParent = xdgSurface->window()->transientParent()) {
|
||||
if (auto parentSurface =
|
||||
qobject_cast<QWaylandXdgSurface *>(transientParent->shellSurface())) {
|
||||
auto parentSurface = qobject_cast<QWaylandXdgSurface *>(transientParent->shellSurface());
|
||||
if (parentSurface && parentSurface->m_toplevel) {
|
||||
set_parent(parentSurface->m_toplevel->object());
|
||||
if (window->modality() != Qt::NonModal && m_xdgSurface->m_shell->m_xdgDialogWm) {
|
||||
m_xdgDialog.reset(m_xdgSurface->m_shell->m_xdgDialogWm->getDialog(object()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user