Accepting request 562917 from KDE:Qt5
- Add patch (pending upstream) to fix destruction of hidden surfaces (kde#381630): * Dont-recreate-hidden-egl-surfaces.patch - Keep workaround-null-object.patch as it can in theory prevent crashes and has no effect otherwise OBS-URL: https://build.opensuse.org/request/show/562917 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtwayland?expand=0&rev=19
This commit is contained in:
parent
5f056bb474
commit
2f42fa56a8
103
Dont-recreate-hidden-egl-surfaces.patch
Normal file
103
Dont-recreate-hidden-egl-surfaces.patch
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
From a343c589a966d0342fcc75e0d6ce24e1f5157540 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
|
||||||
|
---
|
||||||
|
.../client/wayland-egl/qwaylandglcontext.cpp | 2 +-
|
||||||
|
tests/auto/client/client/tst_client.cpp | 35 ++++++++++++++++++++++
|
||||||
|
2 files changed, 36 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: qtwayland-everywhere-src-5.10.0/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
||||||
|
===================================================================
|
||||||
|
--- qtwayland-everywhere-src-5.10.0.orig/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
||||||
|
+++ qtwayland-everywhere-src-5.10.0/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
||||||
|
@@ -407,7 +407,7 @@ bool QWaylandGLContext::makeCurrent(QPla
|
||||||
|
window->createDecoration();
|
||||||
|
|
||||||
|
if (eglSurface == EGL_NO_SURFACE) {
|
||||||
|
- window->updateSurface(true);
|
||||||
|
+ window->updateSurface(window->isExposed());
|
||||||
|
eglSurface = window->eglSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
Index: qtwayland-everywhere-src-5.10.0/tests/auto/client/client/tst_client.cpp
|
||||||
|
===================================================================
|
||||||
|
--- qtwayland-everywhere-src-5.10.0.orig/tests/auto/client/client/tst_client.cpp
|
||||||
|
+++ qtwayland-everywhere-src-5.10.0/tests/auto/client/client/tst_client.cpp
|
||||||
|
@@ -35,6 +35,8 @@
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QPixmap>
|
||||||
|
#include <QDrag>
|
||||||
|
+#include <QWindow>
|
||||||
|
+#include <QOpenGLWindow>
|
||||||
|
|
||||||
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
@@ -108,6 +110,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
|
||||||
|
@@ -145,6 +166,7 @@ private slots:
|
||||||
|
void dontCrashOnMultipleCommits();
|
||||||
|
void hiddenTransientParent();
|
||||||
|
void hiddenPopupParent();
|
||||||
|
+ void glWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MockCompositor *compositor;
|
||||||
|
@@ -404,6 +426,19 @@ void tst_WaylandClient::hiddenPopupParen
|
||||||
|
QTRY_VERIFY(compositor->surface());
|
||||||
|
}
|
||||||
|
|
||||||
|
+void tst_WaylandClient::glWindow()
|
||||||
|
+{
|
||||||
|
+ 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);
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 9 14:39:26 UTC 2018 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Add patch (pending upstream) to fix destruction of hidden surfaces (kde#381630):
|
||||||
|
* Dont-recreate-hidden-egl-surfaces.patch
|
||||||
|
- Keep workaround-null-object.patch as it can in theory prevent
|
||||||
|
crashes and has no effect otherwise
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 1 01:03:04 UTC 2018 - fabian@ritter-vogt.de
|
Mon Jan 1 01:03:04 UTC 2018 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ Source: https://download.qt.io/official_releases/qt/5.10/%{real_version}
|
|||||||
Source1: baselibs.conf
|
Source1: baselibs.conf
|
||||||
# PATCH-FIX-OPENSUSE
|
# PATCH-FIX-OPENSUSE
|
||||||
Patch1: workaround-null-object.patch
|
Patch1: workaround-null-object.patch
|
||||||
|
# Pending for upstream 5.9 (https://codereview.qt-project.org/#/c/210552/)
|
||||||
|
Patch1500: Dont-recreate-hidden-egl-surfaces.patch
|
||||||
# Patches from upstream dev branch
|
# Patches from upstream dev branch
|
||||||
Patch2000: 0001-Implement-basic-key-composition-support.patch
|
Patch2000: 0001-Implement-basic-key-composition-support.patch
|
||||||
Patch2001: 0002-Automatically-change-scale-when-entering-a-new-outpu.patch
|
Patch2001: 0002-Automatically-change-scale-when-entering-a-new-outpu.patch
|
||||||
@ -107,6 +109,7 @@ Examples for libqt5-qtwayland module.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{tar_version}
|
%setup -q -n %{tar_version}
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch1500 -p1
|
||||||
%patch2000 -p1
|
%patch2000 -p1
|
||||||
%patch2001 -p1
|
%patch2001 -p1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user