summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2019-11-16 13:32:26 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2019-11-20 22:20:41 +0100
commit3ea3863bbb23502f530f9f22e1053439891053b9 (patch)
tree2867a7bd71f9f3ec2df24787b1a628b62695aaf0
parentdev-qt/qtwayland: Fix touch ignored if down and motion in same frame (diff)
downloadgentoo-3ea3863bbb23502f530f9f22e1053439891053b9.tar.gz
gentoo-3ea3863bbb23502f530f9f22e1053439891053b9.tar.bz2
gentoo-3ea3863bbb23502f530f9f22e1053439891053b9.zip
dev-qt/qtwayland: Fix crash when showing a window with hidden parent
Package-Manager: Portage-2.3.79, Repoman-2.3.17 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--dev-qt/qtwayland/files/qtwayland-5.13.2-fix-crash.patch55
-rw-r--r--dev-qt/qtwayland/qtwayland-5.13.2-r1.ebuild1
2 files changed, 56 insertions, 0 deletions
diff --git a/dev-qt/qtwayland/files/qtwayland-5.13.2-fix-crash.patch b/dev-qt/qtwayland/files/qtwayland-5.13.2-fix-crash.patch
new file mode 100644
index 000000000000..b4e78684bb61
--- /dev/null
+++ b/dev-qt/qtwayland/files/qtwayland-5.13.2-fix-crash.patch
@@ -0,0 +1,55 @@
+From 962b9be7992cef672cb6307af5653c97382c334f Mon Sep 17 00:00:00 2001
+From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
+Date: Fri, 1 Nov 2019 11:24:26 +0100
+Subject: [PATCH] Client: Fix crash when showing a child window with a hidden
+ parent
+
+[ChangeLog][QPA plugin] Fixed a crash when showing a window with a hidden
+parent.
+
+Now we just avoid creating the subsurface, so nothing is shown. Seems to be
+the same behavior as on xcb.
+
+Fixes: QTBUG-79674
+Change-Id: Ia46fcd9a0da5aad4704816a41515cb1e128ac65f
+Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
+---
+ src/client/qwaylanddisplay.cpp | 4 ++++
+ 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 78524f6fc..27e38ccf7 100644
+--- a/src/client/qwaylanddisplay.cpp
++++ b/src/client/qwaylanddisplay.cpp
+@@ -109,6 +109,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->object());
++ Q_ASSERT(window->object());
++
+ return mSubCompositor->get_subsurface(window->object(), parent->object());
+ }
+
+diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
+index 8d34afd1f..7098568b4 100644
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -124,9 +124,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->object()) {
++ if (::wl_subsurface *subsurface = mDisplay->createSubSurface(this, parent))
++ mSubSurfaceWindow = new QWaylandSubSurface(this, parent, subsurface);
+ }
+ } else if (shouldCreateShellSurface()) {
+ Q_ASSERT(!mShellSurface);
+--
+2.16.3
diff --git a/dev-qt/qtwayland/qtwayland-5.13.2-r1.ebuild b/dev-qt/qtwayland/qtwayland-5.13.2-r1.ebuild
index 23b38b6f8d7e..7c452ff8e0b3 100644
--- a/dev-qt/qtwayland/qtwayland-5.13.2-r1.ebuild
+++ b/dev-qt/qtwayland/qtwayland-5.13.2-r1.ebuild
@@ -28,6 +28,7 @@ RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}/${P}-fix-touch-ignored.patch" # QTBUG-79744
+ "${FILESDIR}/${P}-fix-crash.patch" # QTBUG-79674
)
src_prepare() {