temp/qt5-qtwayland: apply patches suggested by upstream (!509)

These patches are intended to make things work nicely due to regressions
introduced in qt5.12.4. I've tested them in QEMU and they seem to work
fine.

See: https://mail.kde.org/pipermail/kde-distro-packagers/2019-July/000379.html
This commit is contained in:
Bhushan Shah 2019-07-18 17:58:25 +05:30
parent 326dc7b8b5
commit 9e3fa6e6f7
No known key found for this signature in database
GPG key ID: C4280ACB000B060F
10 changed files with 632 additions and 0 deletions

View file

@ -0,0 +1,38 @@
From e008c69e231169425e2ae602deabc0eb749376ab Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Wed, 29 May 2019 11:56:04 +0200
Subject: [PATCH 1/8] Fix compile error with -no-opengl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ChangeLog][Compositor] Fixed a build error when configured with -no-opengl.
This is the same fix as in dev's 8663de3f, but leaves the QML APIs disabled.
Fixes: QTBUG-76104
Change-Id: I9807144e0c0cf33d421c7c6adcb2664e1e67368c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
---
src/compositor/compositor_api/qwaylandcompositor.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index a0d69c52..52ffb916 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -243,8 +243,10 @@ QWaylandCompositorPrivate::~QWaylandCompositorPrivate()
delete data_device_manager;
#endif
+#if QT_CONFIG(opengl)
// Some client buffer integrations need to clean up before the destroying the wl_display
client_buffer_integration.reset();
+#endif
wl_display_destroy(display);
}
--
2.17.1

View file

@ -0,0 +1,72 @@
From cde2fe3fba31b9b8d258f0663bc34009fd769efd Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Wed, 6 Mar 2019 13:20:04 +0100
Subject: [PATCH 2/8] Compositor: Map touch ids to contiguous ids
The protocol doesn't require this, but some clients seem to depend on it
nevertheless.
Fixes: QTBUG-75667
Change-Id: I47491c396d3c9193c7e51e13c7ca1586246e335c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 869a38c082daf150a16b2abb230b420de3e4af31)
---
.../compositor_api/qwaylandtouch.cpp | 19 ++++++++++++++++++-
.../compositor_api/qwaylandtouch_p.h | 2 ++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp
index 3e729800..15746cb5 100644
--- a/src/compositor/compositor_api/qwaylandtouch.cpp
+++ b/src/compositor/compositor_api/qwaylandtouch.cpp
@@ -98,6 +98,20 @@ void QWaylandTouchPrivate::sendMotion(QWaylandClient *client, uint32_t time, int
wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y()));
}
+int QWaylandTouchPrivate::toSequentialWaylandId(int touchId)
+{
+ const int waylandId = ids.indexOf(touchId);
+ if (waylandId != -1)
+ return waylandId;
+ const int availableId = ids.indexOf(-1);
+ if (availableId != -1) {
+ ids[availableId] = touchId;
+ return availableId;
+ }
+ ids.append(touchId);
+ return ids.length() - 1;
+}
+
/*!
* \class QWaylandTouch
* \inmodule QtWaylandCompositor
@@ -212,7 +226,10 @@ void QWaylandTouch::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *ev
for (int i = 0; i < pointCount; ++i) {
const QTouchEvent::TouchPoint &tp(points.at(i));
// Convert the local pos in the compositor window to surface-relative.
- sendTouchPointEvent(surface, tp.id(), tp.pos(), tp.state());
+ const int id = d->toSequentialWaylandId(tp.id());
+ sendTouchPointEvent(surface, id, tp.pos(), tp.state());
+ if (tp.state() == Qt::TouchPointReleased)
+ d->ids[id] = -1;
}
sendFrameEvent(surface->client());
}
diff --git a/src/compositor/compositor_api/qwaylandtouch_p.h b/src/compositor/compositor_api/qwaylandtouch_p.h
index de1b748d..0b87f847 100644
--- a/src/compositor/compositor_api/qwaylandtouch_p.h
+++ b/src/compositor/compositor_api/qwaylandtouch_p.h
@@ -80,8 +80,10 @@ public:
private:
void touch_release(Resource *resource) override;
+ int toSequentialWaylandId(int touchId);
QWaylandSeat *seat = nullptr;
+ QVarLengthArray<int, 10> ids;
};
QT_END_NAMESPACE
--
2.17.1

View file

@ -0,0 +1,37 @@
From af9ec8a76d7e62444fadb518256fc58723fe5186 Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Wed, 5 Jun 2019 13:10:38 +0200
Subject: [PATCH 3/8] Client: Don't add all windows to activePopups
Neither Qt::ToolTip nor Qt::Popup are single bits in Qt::WindowFlags, and do in
fact include Qt::Window. This meant that when we or'ed them and did a bitwise
and with QWindow::type(), we would match more types than just Qt::Popup and
Qt::ToolTip. We would for instance get any Qt::Window as well, which meant the
main window would be added to activePopups, leading to strange things
happening, such as crashes and the main window closing unexpectedly.
[ChangeLog][QPA plugin] Fixed a crash when closing multiple popups at once.
Fixes: QTBUG-76124
Change-Id: I1a6a59e161a436604a7ac8ab824396481dc99a20
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
---
src/client/qwaylandwindow.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 58e0fc58..cecdbda9 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -393,7 +393,7 @@ QWaylandScreen *QWaylandWindow::calculateScreenFromSurfaceEvents() const
void QWaylandWindow::setVisible(bool visible)
{
if (visible) {
- if (window()->type() & (Qt::Popup | Qt::ToolTip))
+ if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
activePopups << this;
initWindow();
mDisplay->flushRequests();
--
2.17.1

View file

@ -0,0 +1,36 @@
From af00b80178138e55be7ea892a118e6357798e0f2 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Wed, 12 Jun 2019 16:03:13 +0200
Subject: [PATCH 4/8] Don't crash if we start a drag without dragFocus
Sometimes origin will be nullptr, triggering a crash.
[ChangeLog][QPA plugin] Fixed a crash that sometimes happened when
starting a drag-and-drop operation.
Fixes: QTBUG-76368
Change-Id: I8f4e6b05f073644834c3c72a8307dac5b897f626
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
---
src/client/qwaylanddatadevice.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
index 300c9de0..11984f9d 100644
--- a/src/client/qwaylanddatadevice.cpp
+++ b/src/client/qwaylanddatadevice.cpp
@@ -111,7 +111,10 @@ void QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon)
if (!origin)
origin = m_display->currentInputDevice()->touchFocus();
- start_drag(m_dragSource->object(), origin->object(), icon->object(), m_display->currentInputDevice()->serial());
+ if (origin)
+ start_drag(m_dragSource->object(), origin->object(), icon->object(), m_display->currentInputDevice()->serial());
+ else
+ qCDebug(lcQpaWayland) << "Couldn't start a drag because the origin window could not be found.";
}
void QWaylandDataDevice::cancelDrag()
--
2.17.1

View file

@ -0,0 +1,134 @@
From ec9057081f1094fbfeb11449bc533997731e4079 Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Wed, 19 Jun 2019 14:05:22 +0200
Subject: [PATCH 5/8] Client: Fix stuttering when the GUI thread is busy
When we did invokeMethod for handling the frame callbacks, we had to wait for
the GUI thread to finish whatever it's doing before we would stop blocking.
Fix it by clearing the frame callback timer and stop blocking immediately,
while delaying the rest of the work until it can be run on the other thread.
Fixes: QTBUG-76397
Change-Id: I343e4feac4838926b4fa2ccac2948988bc6c3bb7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
---
src/client/qwaylandwindow.cpp | 59 ++++++++++++++++++-----------------
src/client/qwaylandwindow_p.h | 2 +-
2 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index cecdbda9..7c8ecada 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -610,29 +610,34 @@ const wl_callback_listener QWaylandWindow::callbackListener = {
Q_UNUSED(callback);
Q_UNUSED(time);
auto *window = static_cast<QWaylandWindow*>(data);
- if (window->thread() != QThread::currentThread())
- QMetaObject::invokeMethod(window, [=] { window->handleFrameCallback(); }, Qt::QueuedConnection);
- else
- window->handleFrameCallback();
+ window->handleFrameCallback();
}
};
void QWaylandWindow::handleFrameCallback()
{
- bool wasExposed = isExposed();
+ // Stop the timer and stop waiting immediately
+ int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ mWaitingForFrameCallback = false;
- if (mFrameCallbackTimerId != -1) {
- killTimer(mFrameCallbackTimerId);
- mFrameCallbackTimerId = -1;
- }
+ // The rest can wait until we can run it on the correct thread
+ auto doHandleExpose = [this, timerId]() {
+ if (timerId != -1)
+ killTimer(timerId);
- mWaitingForFrameCallback = false;
- mFrameCallbackTimedOut = false;
+ bool wasExposed = isExposed();
+ mFrameCallbackTimedOut = false;
+ if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed?
+ sendExposeEvent(QRect(QPoint(), geometry().size()));
+ if (wasExposed && hasPendingUpdateRequest())
+ deliverUpdateRequest();
+ };
- if (!wasExposed && isExposed())
- sendExposeEvent(QRect(QPoint(), geometry().size()));
- if (wasExposed && hasPendingUpdateRequest())
- deliverUpdateRequest();
+ if (thread() != QThread::currentThread()) {
+ QMetaObject::invokeMethod(this, doHandleExpose);
+ } else {
+ doHandleExpose();
+ }
}
QMutex QWaylandWindow::mFrameSyncMutex;
@@ -654,11 +659,11 @@ bool QWaylandWindow::waitForFrameSync(int timeout)
}
// Stop current frame timer if any, can't use killTimer directly, because we might be on a diffent thread
- if (mFrameCallbackTimerId != -1) {
- int id = mFrameCallbackTimerId;
- mFrameCallbackTimerId = -1;
- QMetaObject::invokeMethod(this, [=] { killTimer(id); }, Qt::QueuedConnection);
- }
+ // Ordered semantics is needed to avoid stopping the timer twice and not miss it when it's
+ // started by other writes
+ int fcbId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ if (fcbId != -1)
+ QMetaObject::invokeMethod(this, [=] { killTimer(fcbId); }, Qt::QueuedConnection);
return !mWaitingForFrameCallback;
}
@@ -1090,9 +1095,9 @@ void QWaylandWindow::timerEvent(QTimerEvent *event)
}
}
- if (event->timerId() == mFrameCallbackTimerId) {
- killTimer(mFrameCallbackTimerId);
- mFrameCallbackTimerId = -1;
+
+ if (mFrameCallbackTimerId.testAndSetOrdered(event->timerId(), -1)) {
+ killTimer(event->timerId());
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
mFrameCallbackTimedOut = true;
mWaitingForUpdate = false;
@@ -1154,11 +1159,9 @@ void QWaylandWindow::handleUpdate()
mWaitingForUpdate = false;
// Stop current frame timer if any, can't use killTimer directly, see comment above.
- if (mFrameCallbackTimerId != -1) {
- int id = mFrameCallbackTimerId;
- mFrameCallbackTimerId = -1;
- QMetaObject::invokeMethod(this, [=] { killTimer(id); }, Qt::QueuedConnection);
- }
+ int fcbId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ if (fcbId != -1)
+ QMetaObject::invokeMethod(this, [=] { killTimer(fcbId); }, Qt::QueuedConnection);
// Start a timer for handling the case when the compositor stops sending frame callbacks.
QMetaObject::invokeMethod(this, [=] { // Again; can't do it directly
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index c47123dc..e8c9d568 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -216,7 +216,7 @@ protected:
WId mWindowId;
bool mWaitingForFrameCallback = false;
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
- int mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback
+ QAtomicInt mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback
struct ::wl_callback *mFrameCallback = nullptr;
struct ::wl_event_queue *mFrameQueue = nullptr;
QWaitCondition mFrameSyncWait;
--
2.17.1

View file

@ -0,0 +1,40 @@
From a4e6f88f50d1a1dd56df77ce8b07b98aceb20ddc Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 13:25:16 +0200
Subject: [PATCH 6/8] Client: Reset frame callback timer when hiding a window
If we hide a window whilst a compositor has a pending frame to show,
it's possible the compositor will not render the frame and not return
the callback.
If this happens on the next window expose we can be left with
mFrameCallbackTimedOut still true causing isExposed() to remain false
and us to not send the next buffer when we later show the window again.
Change-Id: I507410415d1a930fd5fa736412055e68fdf6c1d3
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
---
src/client/qwaylandwindow.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7c8ecada..2b243bc4 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -254,6 +254,13 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mFrameCallback = nullptr;
}
+ int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ if (timerId != -1) {
+ killTimer(timerId);
+ }
+ mWaitingForFrameCallback = false;
+ mFrameCallbackTimedOut = false;
+
mMask = QRegion();
mQueuedBuffer = nullptr;
}
--
2.17.1

View file

@ -0,0 +1,40 @@
From a4e6f88f50d1a1dd56df77ce8b07b98aceb20ddc Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 13:25:16 +0200
Subject: [PATCH] Client: Reset frame callback timer when hiding a window
If we hide a window whilst a compositor has a pending frame to show,
it's possible the compositor will not render the frame and not return
the callback.
If this happens on the next window expose we can be left with
mFrameCallbackTimedOut still true causing isExposed() to remain false
and us to not send the next buffer when we later show the window again.
Change-Id: I507410415d1a930fd5fa736412055e68fdf6c1d3
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
---
src/client/qwaylandwindow.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7c8ecadaa..2b243bc44 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -254,6 +254,13 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mFrameCallback = nullptr;
}
+ int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ if (timerId != -1) {
+ killTimer(timerId);
+ }
+ mWaitingForFrameCallback = false;
+ mFrameCallbackTimedOut = false;
+
mMask = QRegion();
mQueuedBuffer = nullptr;
}
--
2.16.3

View file

@ -0,0 +1,83 @@
From b13b595dc4f4fe6bdca7b69a21fd934ee233e149 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 14:48:30 +0200
Subject: [PATCH] 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 | 10 +++++++++-
src/client/qwaylandwindow_p.h | 4 ++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 5ea0dce1e..7e7a4929c 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -79,6 +79,8 @@ Q_LOGGING_CATEGORY(lcWaylandBackingstore, "qt.qpa.wayland.backingstore")
QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
+QReadWriteLock mSurfaceLock;
+
QWaylandWindow::QWaylandWindow(QWindow *window)
: QPlatformWindow(window)
, mDisplay(waylandScreen()->display())
@@ -210,6 +212,7 @@ void QWaylandWindow::initWindow()
void QWaylandWindow::initializeWlSurface()
{
+ QWriteLocker lock(&mSurfaceLock);
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
}
@@ -245,8 +248,10 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mShellSurface = nullptr;
delete mSubSurfaceWindow;
mSubSurfaceWindow = nullptr;
- if (isInitialized())
+ if (isInitialized()) {
+ QWriteLocker lock(&mSurfaceLock);
destroy();
+ }
mScreens.clear();
if (mFrameCallback) {
@@ -1145,6 +1150,9 @@ 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 e8c9d5684..d3706442f 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>
@@ -271,6 +273,8 @@ private:
static QMutex mFrameSyncMutex;
static QWaylandWindow *mMouseGrab;
+ QReadWriteLock mSurfaceLock;
+
friend class QWaylandSubSurface;
};
--
2.16.3

View file

@ -0,0 +1,93 @@
From e6edc73942a76e57e7ac745217092333480f2c64 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 23 Jun 2019 15:09:51 +0200
Subject: [PATCH] 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
---
.../wayland/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 aa0cb58a4..16f18fd7a 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 ca7c8495c..a6331621d 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -93,7 +93,7 @@ QWaylandWindow::~QWaylandWindow()
delete mWindowDecoration;
if (isInitialized())
- reset(false);
+ reset();
const QWindow *parent = window();
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
@@ -119,8 +119,6 @@ void QWaylandWindow::initWindow()
if (!isInitialized()) {
initializeWlSurface();
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
- QGuiApplication::sendEvent(window(), &e);
}
if (shouldCreateSubSurface()) {
@@ -227,12 +225,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 121ad8219..ba69fd9dc 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -263,7 +263,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.16.3

View file

@ -0,0 +1,59 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt5-qtwayland
_pkgname="${pkgname/qt5-/}-everywhere-src"
pkgver=9999
_pkgver=5.12.4
pkgrel=0
arch="all"
url="http://qt-project.org/"
license="LGPL-2.0 with exceptions or GPL-3.0 with exceptions"
pkgdesc='Provides APIs for Wayland'
makedepends="$depends_dev libxkbcommon-dev libxcomposite-dev
qt5-qtquickcontrols2-dev qt5-qtdeclarative-dev qt5-qtbase-dev wayland-dev"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/$_pkgname-$_pkgver"
case $_pkgver in
*_beta*|*_rc*) _rel=development_releases;;
*) _rel=official_releases;;
esac
source="http://download.qt.io/$_rel/qt/${_pkgver%.*}/${_pkgver}/submodules/$_pkgname-$_pkgver.tar.xz
0001-Fix-compile-error-with-no-opengl.patch
0002-Compositor-Map-touch-ids-to-contiguous-ids.patch
0004-Don-t-crash-if-we-start-a-drag-without-dragFocus.patch
0005-Client-Fix-stuttering-when-the-GUI-thread-is-busy.patch
0006-Client-Reset-frame-callback-timer-when-hiding-a-wind.patch
265998.patch
265999.patch"
build() {
qmake-qt5
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="f3fd6644d7fa21ef042ecda807f6ede7853944de8908f8d390f0ebec258406ff4a4f3bfbb382b57a7a4684e19906b79b43c920f55c5fda75bacfc9a96fafa301 qtwayland-everywhere-src-5.12.4.tar.xz
a62631eaec27481a9283ebb6b16102f2b90cf56a438180672f6e6853d3b027cb12ef71db84e9f300ceb954ff90583f73b037b3263eff67603d8caf9b1f0a32b7 0001-Fix-compile-error-with-no-opengl.patch
9301192593c419aabe062510057abbe15e805d97660ab6d5c1f3f93e1cb24e7bec51697d8f6c4ba70212d50716cab61614aa0863762b70172b5efafe52ee90af 0002-Compositor-Map-touch-ids-to-contiguous-ids.patch
77d1d62ca11994f9eb459b21c2bc461be2e89814c631c23ca635ab02cb4ebacd5fc793c132482d3ef333ca6995dc89715b3a34052bb1f409bc405d350255820e 0004-Don-t-crash-if-we-start-a-drag-without-dragFocus.patch
3633d1a0352e61fdf5db6bd48f8f9c263b6166661feb3d19d6d6efabfbef5d8baa8400321abe1e563812d4a2c07b683dedfef03833ea7fa59c3cbe828ad4d634 0005-Client-Fix-stuttering-when-the-GUI-thread-is-busy.patch
fe8ed559dffd5a62dd8a93db225f4d0f84cc6709bb5bf7321cd39d9c8aec6692252018a8d23f85bb91d798f4b073c29ba9f19c0c9ccba1f2231613dd9ed33bb5 0006-Client-Reset-frame-callback-timer-when-hiding-a-wind.patch
f165830a93c8af609e636cade8cffd898a1d3c4b31502077a6cd42a8542ab16ba7f4412f41dc4e936aa0251f4937a4db686c14580363721fe257be8de31f17c7 265998.patch
e0962e279abff5e66a4676c0570682f1c6f2e9032295bce24467c0d1841f9fe9af19bf84c0034f2f4c0cf5e7afc9e07b5032239d7b0f0b5df4e932eb5e4835bf 265999.patch"