summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
commit741506eb89a59f960f25706329e7b4d0332c1eb9 (patch)
tree336ae12dcd8ed37f8a789b9ca388c666979a217a /src
parent1a52c4db428e65f4a0b92bea5811014aaa387263 (diff)
parentacddf1834ffa1b256a38919d9626f1e12460b484 (diff)
Merge remote-tracking branch 'origin/5.15' into devHEADdev
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylanddisplay.cpp4
-rw-r--r--src/client/qwaylandwindow.cpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index a17e8917..0464d3a4 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -114,6 +114,10 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
return nullptr;
}
+ // Make sure we don't pass NULL surfaces to libwayland (crashes)
+ Q_ASSERT(parent->wlSurface());
+ Q_ASSERT(window->wlSurface());
+
return mSubCompositor->get_subsurface(window->wlSurface(), parent->wlSurface());
}
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index bffb5701..950486c0 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -125,9 +125,10 @@ void QWaylandWindow::initWindow()
if (shouldCreateSubSurface()) {
Q_ASSERT(!mSubSurfaceWindow);
- QWaylandWindow *p = static_cast<QWaylandWindow *>(QPlatformWindow::parent());
- if (::wl_subsurface *ss = mDisplay->createSubSurface(this, p)) {
- mSubSurfaceWindow = new QWaylandSubSurface(this, p, ss);
+ auto *parent = static_cast<QWaylandWindow *>(QPlatformWindow::parent());
+ if (parent->wlSurface()) {
+ if (::wl_subsurface *subsurface = mDisplay->createSubSurface(this, parent))
+ mSubSurfaceWindow = new QWaylandSubSurface(this, parent, subsurface);
}
} else if (shouldCreateShellSurface()) {
Q_ASSERT(!mShellSurface);