public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwayland/files/, dev-qt/qtwayland/
Date: Wed,  7 Feb 2018 14:17:37 +0000 (UTC)	[thread overview]
Message-ID: <1518013038.4421b5d072f2f5d4a7694a0e40306e198927ec34.asturm@gentoo> (raw)

commit:     4421b5d072f2f5d4a7694a0e40306e198927ec34
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  7 11:28:34 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Feb  7 14:17:18 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4421b5d0

dev-qt/qtwayland: Don't recreate hidden egl surfaces

Fixing a runtime crash that affects many users.
Patch taken from 5.9 branch (fixed in 5.9.5).

KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=381630
Qt-Bug: https://bugreports.qt.io/browse/QTBUG-65553
See also: https://codereview.qt-project.org/#/c/210552/
Tested-by: Andrius Štikonas <andrius <AT> stikonas.eu>

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../files/qtwayland-5.9.4-qquickwindow-crash.patch | 109 +++++++++++++++++++++
 dev-qt/qtwayland/qtwayland-5.9.4-r1.ebuild         |  41 ++++++++
 2 files changed, 150 insertions(+)

diff --git a/dev-qt/qtwayland/files/qtwayland-5.9.4-qquickwindow-crash.patch b/dev-qt/qtwayland/files/qtwayland-5.9.4-qquickwindow-crash.patch
new file mode 100644
index 00000000000..40f2a6dff4e
--- /dev/null
+++ b/dev-qt/qtwayland/files/qtwayland-5.9.4-qquickwindow-crash.patch
@@ -0,0 +1,109 @@
+From bf09c7a1493c01a65ee0f110b37a04e653edc08e Mon Sep 17 00:00:00 2001
+From: David Edmundson <davidedmundson@kde.org>
+Date: Wed, 3 Jan 2018 19:18:42 +0000
+Subject: [PATCH] Don't recreate hidden egl surfaces
+
+QWaylandEglWindow deletes surfaces when a window changes from hidden to
+visible, presumably as a result of us not having a valid wl_surface
+object. By extension it doesn't make sense to create a surface whilst a
+window is still hidden.
+
+This fixes a crash where a QQuickWindow hides and then is destroyed. In
+QQuickWindow destruction we have to create a valid context in order to
+delete any textures/assets owned by the scene graph; as the wl_surface
+has gone this causes an error in the EGL libs when we create an EGL
+surface.
+
+Task-number: QTBUG-65553
+Change-Id: I9b37a86326bf2cd7737c4e839c1aa8c74cf08116
+Reviewed-by: Johan Helsing <johan.helsing@qt.io>
+---
+ .../client/wayland-egl/qwaylandglcontext.cpp       |  2 +-
+ tests/auto/client/client/tst_client.cpp            | 37 ++++++++++++++++++++++
+ 2 files changed, 38 insertions(+), 1 deletion(-)
+
+diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+index 2a9e39e..f4dd6f4 100644
+--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
++++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+@@ -407,7 +407,7 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
+         window->createDecoration();
+ 
+     if (eglSurface == EGL_NO_SURFACE) {
+-        window->updateSurface(true);
++        window->updateSurface(window->isExposed());
+         eglSurface = window->eglSurface();
+     }
+ 
+diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
+index 3897bd3..aed601d 100644
+--- a/tests/auto/client/client/tst_client.cpp
++++ b/tests/auto/client/client/tst_client.cpp
+@@ -35,6 +35,8 @@
+ #include <QMimeData>
+ #include <QPixmap>
+ #include <QDrag>
++#include <QWindow>
++#include <QOpenGLWindow>
+ 
+ #include <QtTest/QtTest>
+ #include <QtWaylandClient/private/qwaylandintegration_p.h>
+@@ -112,6 +114,25 @@ public:
+     QPoint mousePressPos;
+ };
+ 
++class TestGlWindow : public QOpenGLWindow
++{
++    Q_OBJECT
++
++public:
++    TestGlWindow();
++
++protected:
++    void paintGL() override;
++};
++
++TestGlWindow::TestGlWindow()
++{}
++
++void TestGlWindow::paintGL()
++{
++    glClear(GL_COLOR_BUFFER_BIT);
++}
++
+ class tst_WaylandClient : public QObject
+ {
+     Q_OBJECT
+@@ -149,6 +170,7 @@ private slots:
+     void dontCrashOnMultipleCommits();
+     void hiddenTransientParent();
+     void hiddenPopupParent();
++    void glWindow();
+ 
+ private:
+     MockCompositor *compositor;
+@@ -409,6 +431,21 @@ void tst_WaylandClient::hiddenPopupParent()
+     QTRY_VERIFY(compositor->surface());
+ }
+ 
++void tst_WaylandClient::glWindow()
++{
++    QSKIP("Skipping GL tests, as not supported by all CI systems: See https://bugreports.qt.io/browse/QTBUG-65802");
++
++    QScopedPointer<TestGlWindow> testWindow(new TestGlWindow);
++    testWindow->show();
++    QSharedPointer<MockSurface> surface;
++    QTRY_VERIFY(surface = compositor->surface());
++
++    //confirm we don't crash when we delete an already hidden GL window
++    //QTBUG-65553
++    testWindow->setVisible(false);
++    QTRY_VERIFY(!compositor->surface());
++}
++
+ int main(int argc, char **argv)
+ {
+     setenv("XDG_RUNTIME_DIR", ".", 1);
+-- 
+2.7.4
+

diff --git a/dev-qt/qtwayland/qtwayland-5.9.4-r1.ebuild b/dev-qt/qtwayland/qtwayland-5.9.4-r1.ebuild
new file mode 100644
index 00000000000..16a5d921047
--- /dev/null
+++ b/dev-qt/qtwayland/qtwayland-5.9.4-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit qt5-build
+
+DESCRIPTION="Wayland platform plugin for Qt"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+fi
+
+IUSE="+libinput xcomposite"
+
+DEPEND="
+	>=dev-libs/wayland-1.6.0
+	~dev-qt/qtcore-${PV}
+	~dev-qt/qtdeclarative-${PV}
+	~dev-qt/qtgui-${PV}[egl,libinput?]
+	media-libs/mesa[egl]
+	>=x11-libs/libxkbcommon-0.2.0
+	xcomposite? (
+		x11-libs/libX11
+		x11-libs/libXcomposite
+	)
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-qquickwindow-crash.patch" ) # 5.9 branch
+
+src_prepare() {
+	qt_use_disable_config libinput xkbcommon-evdev \
+		src/client/client.pro \
+		src/compositor/wayland_wrapper/wayland_wrapper.pri \
+		src/plugins/shellintegration/ivi-shell/ivi-shell.pro \
+		tests/auto/compositor/compositor/compositor.pro
+
+	use xcomposite || rm -r config.tests/xcomposite || die
+
+	qt5-build_src_prepare
+}


             reply	other threads:[~2018-02-07 14:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 14:17 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-07-20  8:52 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwayland/files/, dev-qt/qtwayland/ Andreas Sturmlechner
2019-11-20 21:21 Andreas Sturmlechner
2019-11-25  1:35 Andreas Sturmlechner
2022-02-08 19:58 Andreas Sturmlechner
2022-02-15 10:23 Andreas Sturmlechner
2022-04-15  6:08 Sam James
2023-04-13 21:45 Andreas Sturmlechner
2023-07-14  7:29 Sam James
2023-08-15 19:57 Andreas Sturmlechner
2023-09-19 12:11 Andreas Sturmlechner
2024-02-14 12:24 Ionen Wolkens
2024-04-19  7:55 Ionen Wolkens
2024-07-09 14:35 Ionen Wolkens
2024-07-12  4:34 Ionen Wolkens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518013038.4421b5d072f2f5d4a7694a0e40306e198927ec34.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox