diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-12 03:05:13 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-12 03:05:13 +0100 |
commit | 741506eb89a59f960f25706329e7b4d0332c1eb9 (patch) | |
tree | 336ae12dcd8ed37f8a789b9ca388c666979a217a /src | |
parent | 1a52c4db428e65f4a0b92bea5811014aaa387263 (diff) | |
parent | acddf1834ffa1b256a38919d9626f1e12460b484 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I9ad2f46e216c431c9388ad6b45848277ba481808
Diffstat (limited to 'src')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index a17e8917a..0464d3a42 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 bffb57015..950486c0c 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); |