Accepting request 734738 from home:Vogtinator:qt5.14

Qt 5.14 Alpha

OBS-URL: https://build.opensuse.org/request/show/734738
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.14/libqt5-qtwayland?expand=0&rev=2
This commit is contained in:
Fabian Vogt 2019-10-05 16:00:59 +00:00 committed by Git OBS Bridge
parent 0f6426dabc
commit 4930960475
8 changed files with 40 additions and 208 deletions

View File

@ -1,93 +0,0 @@
From 20ddfe8dffc3be253d799bc3f939a1b0e388ed73 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 15:09:51 +0200
Subject: [PATCH 3/5] Client: Don't send fake SurfaceCreated/Destroyed events
QPlatformSurface relates to the backing store. Not the wl_surface.
They are emitted by QPlatformWindow.
Due to a previously incorrect usage by KDE developers it was faked to
emit the events when the wl_surface is created/hidden to keep behavior.
With QtBase a9246c7132a2c8864d3ae6cebd260bb9ee711fcb this now causes an
issue as now QWidgets react to this event in a breaking way.
Change-Id: I2f003bc9da85f032a0053677fd281152099fc9eb
---
.../custom-extension/client-common/customextension.cpp | 9 +++++++--
src/client/qwaylandwindow.cpp | 10 ++--------
src/client/qwaylandwindow_p.h | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp
index aa0cb58a..16f18fd7 100644
--- a/examples/wayland/custom-extension/client-common/customextension.cpp
+++ b/examples/wayland/custom-extension/client-common/customextension.cpp
@@ -81,8 +81,13 @@ QWindow *CustomExtension::windowForSurface(struct ::wl_surface *surface)
bool CustomExtension::eventFilter(QObject *object, QEvent *event)
{
- if (event->type() == QEvent::PlatformSurface
- && static_cast<QPlatformSurfaceEvent*>(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
+ if (event->type() == QEvent::Expose) {
+ auto ee = static_cast<QExposeEvent*>(event);
+
+ if ((ee->region().isNull())) {
+ return false;
+ }
+
QWindow *window = qobject_cast<QWindow*>(object);
Q_ASSERT(window);
window->removeEventFilter(this);
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7fca9783..76975b27 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -91,7 +91,7 @@ QWaylandWindow::~QWaylandWindow()
delete mWindowDecoration;
if (isInitialized())
- reset(false);
+ reset();
const QWindow *parent = window();
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
@@ -117,8 +117,6 @@ void QWaylandWindow::initWindow()
if (!isInitialized()) {
initializeWlSurface();
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
- QGuiApplication::sendEvent(window(), &e);
}
if (shouldCreateSubSurface()) {
@@ -224,12 +222,8 @@ bool QWaylandWindow::shouldCreateSubSurface() const
return QPlatformWindow::parent() != nullptr;
}
-void QWaylandWindow::reset(bool sendDestroyEvent)
+void QWaylandWindow::reset()
{
- if (isInitialized() && sendDestroyEvent) {
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
- QGuiApplication::sendEvent(window(), &e);
- }
delete mShellSurface;
mShellSurface = nullptr;
delete mSubSurfaceWindow;
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 86139243..fe24224f 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -261,7 +261,7 @@ private:
void initializeWlSurface();
bool shouldCreateShellSurface() const;
bool shouldCreateSubSurface() const;
- void reset(bool sendDestroyEvent = true);
+ void reset();
void sendExposeEvent(const QRect &rect);
static void closePopups(QWaylandWindow *parent);
QWaylandScreen *calculateScreenFromSurfaceEvents() const;
--
2.22.0

View File

@ -1,80 +0,0 @@
From 71a854f4eced28282df72e1b25888929799e8ee7 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 14:48:30 +0200
Subject: [PATCH 4/5] Client: Make handleUpdate aware of exposure changes
The wl_surface can be destroyed whilst a render is happening. Calling
wl_surface::frame after the window is reset can crash as wl_surface is
null.
Change-Id: I139a9b234cb6acba81d6c1d5fa58629904a25053
---
src/client/qwaylandwindow.cpp | 8 ++++++++
src/client/qwaylandwindow_p.h | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 76975b27..c6723aa7 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -72,6 +72,8 @@ Q_LOGGING_CATEGORY(lcWaylandBackingstore, "qt.qpa.wayland.backingstore")
QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
+QReadWriteLock mSurfaceLock;
+
QWaylandWindow::QWaylandWindow(QWindow *window)
: QPlatformWindow(window)
, mDisplay(waylandScreen()->display())
@@ -197,6 +199,7 @@ void QWaylandWindow::initWindow()
void QWaylandWindow::initializeWlSurface()
{
+ QWriteLocker lock(&mSurfaceLock);
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
}
@@ -230,6 +233,7 @@ void QWaylandWindow::reset()
mSubSurfaceWindow = nullptr;
if (isInitialized()) {
emit wlSurfaceDestroyed();
+ QWriteLocker lock(&mSurfaceLock);
destroy();
}
mScreens.clear();
@@ -1142,6 +1146,10 @@ void QWaylandWindow::requestUpdate()
void QWaylandWindow::handleUpdate()
{
// TODO: Should sync subsurfaces avoid requesting frame callbacks?
+ QReadLocker lock(&mSurfaceLock);
+ if (!isInitialized()) {
+ return;
+ }
if (mFrameCallback) {
wl_callback_destroy(mFrameCallback);
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index fe24224f..97884ba4 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -53,6 +53,8 @@
#include <QtCore/QWaitCondition>
#include <QtCore/QMutex>
+#include <QtCore/QReadWriteLock>
+
#include <QtGui/QIcon>
#include <QtCore/QVariant>
#include <QtCore/QLoggingCategory>
@@ -277,6 +279,8 @@ private:
static QMutex mFrameSyncMutex;
static QWaylandWindow *mMouseGrab;
+ QReadWriteLock mSurfaceLock;
+
friend class QWaylandSubSurface;
};
--
2.22.0

View File

@ -0,0 +1,14 @@
Index: qtwayland-everywhere-src-5.14.0-alpha/src/client/qwaylandinputdevice.cpp
===================================================================
--- qtwayland-everywhere-src-5.14.0-alpha.orig/src/client/qwaylandinputdevice.cpp
+++ qtwayland-everywhere-src-5.14.0-alpha/src/client/qwaylandinputdevice.cpp
@@ -968,6 +968,9 @@ bool QWaylandInputDevice::Pointer::Frame
case axis_source_finger:
case axis_source_continuous:
return !delta.isNull();
+ default:
+ Q_UNREACHABLE();
+ return false;
}
}

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Sep 30 13:30:40 UTC 2019 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 5.14.0-alpha:
* New feature release
* No changelog available
* For more details about Qt 5.14 please see:
https://wiki.qt.io/New_Features_in_Qt_5.14
- Drop patch, cause of the regression was reverted in qtbase:
* 0003-Client-Don-t-send-fake-SurfaceCreated-Destroyed-even.patch
- Drop patch, now upstream:
* 0004-Client-Make-handleUpdate-aware-of-exposure-changes.patch
- Drop patch, it's (hopefully) no longer necessary:
* workaround-null-object.patch
- Add patch to fix build:
* fix-return-nonvoid-function.patch
-------------------------------------------------------------------
Fri Sep 6 08:04:41 UTC 2019 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -19,25 +19,20 @@
%define qt5_snapshot 0
%define libname libQt5WaylandCompositor5
%define base_name libqt5
%define real_version 5.13.1
%define so_version 5.13.1
%define tar_version qtwayland-everywhere-src-5.13.1
%define real_version 5.14.0-alpha
%define so_version 5.14.0
%define tar_version qtwayland-everywhere-src-5.14.0-alpha
Name: libqt5-qtwayland
Version: 5.13.1
Version: 5.14.0~alpha
Release: 0
Summary: Qt 5 Wayland Addon
License: LGPL-2.1-with-Qt-Company-Qt-exception-1.1 or LGPL-3.0-only
Group: Development/Libraries/X11
Url: https://www.qt.io
Source: https://download.qt.io/official_releases/qt/5.13/%{real_version}/submodules/%{tar_version}.tar.xz
Source: https://download.qt.io/development_releases/qt/5.14/%{real_version}/submodules/%{tar_version}.tar.xz
Source1: baselibs.conf
# Those aren't merged upstream yet
# https://codereview.qt-project.org/c/qt/qtwayland/+/265999
Patch3: 0003-Client-Don-t-send-fake-SurfaceCreated-Destroyed-even.patch
# https://codereview.qt-project.org/c/qt/qtwayland/+/265998
Patch4: 0004-Client-Make-handleUpdate-aware-of-exposure-changes.patch
# PATCH-FIX-OPENSUSE
Patch100: workaround-null-object.patch
Patch100: fix-return-nonvoid-function.patch
BuildRequires: fdupes
BuildRequires: libqt5-qtbase-private-headers-devel >= %{version}
BuildRequires: libqt5-qtdeclarative-private-headers-devel >= %{version}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:def836f365b8af99cc693625f2079a54a0f71f5eff3f370dcf6f30b8944caf77
size 478744

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:942832adf3fdd7691fef60f17487a2e51149de0e311b378cfbaa0083103aae0f
size 540596

View File

@ -1,21 +0,0 @@
From: Fabian Vogt <fabian@ritter-vogt.de>
Subject: Work around crash in QtWaylandClient::QWaylandEglWindow::updateSurface
References: kde#381630
object() is nullptr when it crashes, so do not try to reference it.
This is only a workaround as object() should never be nullptr AFAICT.
So far I haven't discovered any bad side effects.
Index: qtwayland-opensource-src-5.9.1/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
===================================================================
--- qtwayland-opensource-src-5.9.1.orig/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ qtwayland-opensource-src-5.9.1/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -112,7 +112,7 @@ void QWaylandEglWindow::updateSurface(bo
// mesa's egl returns NULL if we try to create a, invalid wl_egl_window, however not all EGL
// implementations may do that, so check the size ourself. Besides, we must deal with resizing
// a valid window to 0x0, which would make it invalid. Hence, destroy it.
- if (sizeWithMargins.isEmpty()) {
+ if (sizeWithMargins.isEmpty() || !object()) {
if (m_eglSurface) {
eglDestroySurface(m_clientBufferIntegration->eglDisplay(), m_eglSurface);
m_eglSurface = 0;