diff --git a/.gitignore b/.gitignore index bf75ef2..7f44b9f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /qtwayland-everywhere-src-5.12.1.tar.xz /qtwayland-everywhere-src-5.12.3.tar.xz /qtwayland-everywhere-src-5.12.4.tar.xz +/qtwayland-everywhere-src-5.12.5.tar.xz diff --git a/qt5-qtwayland.spec b/qt5-qtwayland.spec index 3c2a8d3..f39dc2b 100644 --- a/qt5-qtwayland.spec +++ b/qt5-qtwayland.spec @@ -2,8 +2,8 @@ Summary: Qt5 - Wayland platform support and QtCompositor module Name: qt5-%{qt_module} -Version: 5.12.4 -Release: 7%{?dist} +Version: 5.12.5 +Release: 1%{?dist} License: LGPLv3 Url: http://www.qt.io @@ -11,14 +11,7 @@ Url: http://www.qt.io Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-src-%{version}.tar.xz # Upstream patches -Patch0: qtwayland-fix-stuttering-when-gui-thread-is-busy.patch -Patch1: qtwayland-reset-frame-callback-timer-when-hiding-window.patch -Patch2: qtwayland-emit-wl-surfare-lifetime-signals.patch -# Patch3: qtwayland-dont-send-fake-surface-created-destroyed-events.patch -Patch4: qtwayland-make-handleupdate-aware-of-exposure-changes.patch -Patch5: qtwayland-dont-crash-when-start-drag-without-dragfocus.patch -Patch6: qtwayland-fix-expose-event-compression.patch -Patch7: qtwayland-do-not-redraw-decorations-everytime.patch +Patch0: qtwayland-do-not-redraw-decorations-everytime.patch # Upstreamable patches # https://fedoraproject.org/wiki/Changes/Qt_Wayland_By_Default_On_Gnome @@ -127,6 +120,9 @@ popd %changelog +* Tue Sep 24 2019 Jan Grulich - 5.12.5-1 +- 5.12.5 + * Tue Jul 30 2019 Jan Grulich - 5.12.3-6 - Do not redraw decorations everytime diff --git a/qtwayland-dont-crash-when-start-drag-without-dragfocus.patch b/qtwayland-dont-crash-when-start-drag-without-dragfocus.patch deleted file mode 100644 index 9209694..0000000 --- a/qtwayland-dont-crash-when-start-drag-without-dragfocus.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp -index 300c9de..11984f9 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() diff --git a/qtwayland-dont-send-fake-surface-created-destroyed-events.patch b/qtwayland-dont-send-fake-surface-created-destroyed-events.patch deleted file mode 100644 index 0782a94..0000000 --- a/qtwayland-dont-send-fake-surface-created-destroyed-events.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 731ed7f..ed0fe87 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -98,7 +98,7 @@ QWaylandWindow::~QWaylandWindow() - delete mWindowDecoration; - - if (isInitialized()) -- reset(false); -+ reset(); - - QList inputDevices = mDisplay->inputDevices(); - for (int i = 0; i < inputDevices.size(); ++i) -@@ -128,8 +128,6 @@ void QWaylandWindow::initWindow() - - if (!isInitialized()) { - initializeWlSurface(); -- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated); -- QGuiApplication::sendEvent(window(), &e); - } - - if (shouldCreateSubSurface()) { -@@ -237,12 +235,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 0e32b59..746a7a5 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -259,7 +259,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; diff --git a/qtwayland-emit-wl-surfare-lifetime-signals.patch b/qtwayland-emit-wl-surfare-lifetime-signals.patch deleted file mode 100644 index 45822dc..0000000 --- a/qtwayland-emit-wl-surfare-lifetime-signals.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index e3785f5..731ed7f 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -210,7 +210,9 @@ void QWaylandWindow::initWindow() - - void QWaylandWindow::initializeWlSurface() - { -+ Q_ASSERT(!isInitialized()); - init(mDisplay->createSurface(static_cast(this))); -+ emit wlSurfaceCreated(); - } - - bool QWaylandWindow::shouldCreateShellSurface() const -@@ -245,8 +247,10 @@ void QWaylandWindow::reset(bool sendDestroyEvent) - mShellSurface = nullptr; - delete mSubSurfaceWindow; - mSubSurfaceWindow = nullptr; -- if (isInitialized()) -+ if (isInitialized()) { -+ emit wlSurfaceDestroyed(); - destroy(); -+ } - mScreens.clear(); - - if (mFrameCallback) { -diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index c47123d..0e32b59 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -199,6 +199,10 @@ public: - public slots: - void applyConfigure(); - -+signals: -+ void wlSurfaceCreated(); -+ void wlSurfaceDestroyed(); -+ - protected: - void surface_enter(struct ::wl_output *output) override; - void surface_leave(struct ::wl_output *output) override; diff --git a/qtwayland-fix-expose-event-compression.patch b/qtwayland-fix-expose-event-compression.patch deleted file mode 100644 index 4645c96..0000000 --- a/qtwayland-fix-expose-event-compression.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 5e7e215..e4323e8 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -355,7 +355,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) - mSentInitialResize = true; - } - QRect exposeGeometry(QPoint(), geometry().size()); -- if (exposeGeometry != mLastExposeGeometry) -+ if (isExposed() && !mInResizeFromApplyConfigure && exposeGeometry != mLastExposeGeometry) - sendExposeEvent(exposeGeometry); - } - -@@ -367,7 +367,9 @@ void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, cons - QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); - - mOffset += offset; -+ mInResizeFromApplyConfigure = true; - setGeometry(geometry); -+ mInResizeFromApplyConfigure = false; - } - - void QWaylandWindow::sendExposeEvent(const QRect &rect) -diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index d605b52..c82aa8d 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -269,6 +269,7 @@ private: - void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); - void handleScreenChanged(); - -+ bool mInResizeFromApplyConfigure = false; - QRect mLastExposeGeometry; - - static const wl_callback_listener callbackListener; diff --git a/qtwayland-fix-stuttering-when-gui-thread-is-busy.patch b/qtwayland-fix-stuttering-when-gui-thread-is-busy.patch deleted file mode 100644 index bbded1c..0000000 --- a/qtwayland-fix-stuttering-when-gui-thread-is-busy.patch +++ /dev/null @@ -1,127 +0,0 @@ -From ec9057081f1094fbfeb11449bc533997731e4079 Mon Sep 17 00:00:00 2001 -From: Johan Klokkhammer Helsing -Date: Wed, 19 Jun 2019 14:05:22 +0200 -Subject: 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 - -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(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; diff --git a/qtwayland-make-handleupdate-aware-of-exposure-changes.patch b/qtwayland-make-handleupdate-aware-of-exposure-changes.patch deleted file mode 100644 index d51ee72..0000000 --- a/qtwayland-make-handleupdate-aware-of-exposure-changes.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index ed0fe87..da1b6a0 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()) -@@ -209,6 +211,7 @@ void QWaylandWindow::initWindow() - void QWaylandWindow::initializeWlSurface() - { - Q_ASSERT(!isInitialized()); -+ QWriteLocker lock(&mSurfaceLock); - init(mDisplay->createSurface(static_cast(this))); - emit wlSurfaceCreated(); - } -@@ -243,6 +246,7 @@ void QWaylandWindow::reset() - mSubSurfaceWindow = nullptr; - if (isInitialized()) { - emit wlSurfaceDestroyed(); -+ QWriteLocker lock(&mSurfaceLock); - destroy(); - } - mScreens.clear(); -@@ -1138,6 +1142,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 746a7a5..4606a7b 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -53,6 +53,8 @@ - - #include - #include -+#include -+ - #include - #include - #include -@@ -275,6 +277,8 @@ private: - static QMutex mFrameSyncMutex; - static QWaylandWindow *mMouseGrab; - -+ QReadWriteLock mSurfaceLock; -+ - friend class QWaylandSubSurface; - }; - diff --git a/qtwayland-reset-frame-callback-timer-when-hiding-window.patch b/qtwayland-reset-frame-callback-timer-when-hiding-window.patch deleted file mode 100644 index 602d6eb..0000000 --- a/qtwayland-reset-frame-callback-timer-when-hiding-window.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index cecdbda..e3785f5 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; - } diff --git a/sources b/sources index 9749f8c..ca1f479 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (qtwayland-everywhere-src-5.12.4.tar.xz) = f3fd6644d7fa21ef042ecda807f6ede7853944de8908f8d390f0ebec258406ff4a4f3bfbb382b57a7a4684e19906b79b43c920f55c5fda75bacfc9a96fafa301 +SHA512 (qtwayland-everywhere-src-5.12.5.tar.xz) = 19e19b3d6226839856f8e8792665eda1f09f0bbf95a38077bdf2831205ee09254c8df6a521ba3f5a228bcd98c4d1929a2bd9e9aa2f6f14c218d4d7458d1a866c