diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-09 03:05:28 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-09 03:05:28 +0100 |
commit | acddf1834ffa1b256a38919d9626f1e12460b484 (patch) | |
tree | 622aed567a8cbcc6359ce97450ae331e41192d80 /src | |
parent | 8d1fedd6781babaf130486e5c7192b0ebc9fb039 (diff) | |
parent | d66b0218233f2a97eb864aa1bd8bae325b6535e1 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Idf4c63d08423691afd8823c734ba79085aa9e14f
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); |