This commit is contained in:
Rex Dieter 2020-04-04 17:43:45 -05:00
parent 2c1ddbd094
commit 0e587f4d54
8 changed files with 7 additions and 1860 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/qtwayland-everywhere-src-5.12.4.tar.xz
/qtwayland-everywhere-src-5.12.5.tar.xz
/qtwayland-everywhere-src-5.13.2.tar.xz
/qtwayland-everywhere-src-5.14.2.tar.xz

View File

@ -2,8 +2,8 @@
Summary: Qt5 - Wayland platform support and QtCompositor module
Name: qt5-%{qt_module}
Version: 5.13.2
Release: 3%{?dist}
Version: 5.14.2
Release: 1%{?dist}
License: LGPLv3
Url: http://www.qt.io
@ -11,12 +11,6 @@ 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-do-not-redraw-decorations-everytime.patch
Patch1: qtwayland-fix-100ms-freeze-when-apps-dont-swap-after-deliverupdaterequest.patch
Patch2: qtwayland-fix-inverse-repeat-rate-implementation.patch
Patch3: qtwayland-fix-crash-when-showing-child-window-with-hidden-parent.patch
Patch10: qtwayland-implement-primary-selection-unstable-v1.patch
# Upstreamable patches
# https://fedoraproject.org/wiki/Changes/Qt_Wayland_By_Default_On_Gnome
@ -128,6 +122,9 @@ popd
%changelog
* Sat Apr 04 2020 Rex Dieter <rdieter@fedoraproject.org> - 5.14.2-1
- 5.14.2
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.13.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View File

@ -1,33 +0,0 @@
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index 3fe2ce80..6d660e64 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp
@@ -289,11 +289,13 @@ void QWaylandShmBackingStore::resize(const QSize &size)
buffer = getBuffer(sizeWithMargins);
}
- qsizetype oldSize = mBackBuffer ? mBackBuffer->image()->sizeInBytes() : 0;
+ qsizetype oldSizeInBytes = mBackBuffer ? mBackBuffer->image()->sizeInBytes() : 0;
+ qsizetype newSizeInBytes = buffer->image()->sizeInBytes();
+
// mBackBuffer may have been deleted here but if so it means its size was different so we wouldn't copy it anyway
- if (mBackBuffer != buffer && oldSize == buffer->image()->sizeInBytes()) {
- memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), buffer->image()->sizeInBytes());
- }
+ if (mBackBuffer != buffer && oldSizeInBytes == newSizeInBytes)
+ memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), newSizeInBytes);
+
mBackBuffer = buffer;
// ensure the new buffer is at the beginning of the list so next time getBuffer() will pick
// it if possible
@@ -302,8 +304,9 @@ void QWaylandShmBackingStore::resize(const QSize &size)
mBuffers.prepend(buffer);
}
- if (windowDecoration() && window()->isVisible())
+ if (windowDecoration() && window()->isVisible() && oldSizeInBytes != newSizeInBytes) {
windowDecoration()->update();
+ }
}
QImage *QWaylandShmBackingStore::entireSurface() const

View File

@ -1,127 +0,0 @@
From 9f5b96225885f927727a57b6123d8550d6c373bb Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Tue, 15 Oct 2019 09:51:43 +0200
Subject: [PATCH] Client: Fix 100ms freeze when applications do not swap after deliverUpdateRequest
[ChangeLog][QPA plugin] Fixed a 100 ms freeze that would occur if applications
did not draw after receiving a deliverUpdateRequest().
QtQuick does this at the start of animations. This should get rid of those
backingstore warnings (and also remove a 100ms freeze before animations start
in those instances).
Fixes: QTBUG-76813
Change-Id: Id366bf4a14f402fa44530ae46e7b66d9988c14f6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: John Brooks <john.brooks@qt.io>
---
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ae26ba0..8d34afd 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1105,25 +1105,6 @@
void QWaylandWindow::timerEvent(QTimerEvent *event)
{
- if (event->timerId() == mFallbackUpdateTimerId) {
- killTimer(mFallbackUpdateTimerId);
- mFallbackUpdateTimerId = -1;
- qCDebug(lcWaylandBackingstore) << "mFallbackUpdateTimer timed out";
-
- if (!isExposed()) {
- qCDebug(lcWaylandBackingstore) << "Fallback update timer: Window not exposed,"
- << "not delivering update request.";
- return;
- }
-
- if (mWaitingForUpdate && hasPendingUpdateRequest() && !mWaitingForFrameCallback) {
- qCWarning(lcWaylandBackingstore) << "Delivering update request through fallback timer,"
- << "may not be in sync with display";
- deliverUpdateRequest();
- }
- }
-
-
if (mFrameCallbackTimerId.testAndSetOrdered(event->timerId(), -1)) {
killTimer(event->timerId());
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
@@ -1135,6 +1116,7 @@
void QWaylandWindow::requestUpdate()
{
+ qCDebug(lcWaylandBackingstore) << "requestUpdate";
Q_ASSERT(hasPendingUpdateRequest()); // should be set by QPA
// If we have a frame callback all is good and will be taken care of there
@@ -1142,20 +1124,17 @@
return;
// If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet
- if (mWaitingForUpdate) {
- // Ideally, we should just have returned here, but we're not guaranteed that the client
- // will actually update, so start this timer to deliver another request update after a while
- // *IF* the client doesn't update.
- int fallbackTimeout = 100;
- mFallbackUpdateTimerId = startTimer(fallbackTimeout);
- return;
- }
+ // This is a somewhat redundant behavior and might indicate a bug in the calling code, so log
+ // here so we can get this information when debugging update/frame callback issues.
+ // Continue as nothing happened, though.
+ if (mWaitingForUpdate)
+ qCDebug(lcWaylandBackingstore) << "requestUpdate called twice without committing anything";
// Some applications (such as Qt Quick) depend on updates being delivered asynchronously,
// so use invokeMethod to delay the delivery a bit.
QMetaObject::invokeMethod(this, [this] {
// Things might have changed in the meantime
- if (hasPendingUpdateRequest() && !mWaitingForUpdate && !mWaitingForFrameCallback)
+ if (hasPendingUpdateRequest() && !mWaitingForFrameCallback)
deliverUpdateRequest();
}, Qt::QueuedConnection);
}
@@ -1165,6 +1144,7 @@
// Can be called from the render thread (without locking anything) so make sure to not make races in this method.
void QWaylandWindow::handleUpdate()
{
+ qCDebug(lcWaylandBackingstore) << "handleUpdate" << QThread::currentThread();
// TODO: Should sync subsurfaces avoid requesting frame callbacks?
QReadLocker lock(&mSurfaceLock);
if (!isInitialized())
@@ -1175,15 +1155,6 @@
mFrameCallback = nullptr;
}
- if (mFallbackUpdateTimerId != -1) {
- // Ideally, we would stop the fallback timer here, but since we're on another thread,
- // it's not allowed. Instead we set mFallbackUpdateTimer to -1 here, so we'll just
- // ignore it if it times out before it's cleaned up by the invokeMethod call.
- int id = mFallbackUpdateTimerId;
- mFallbackUpdateTimerId = -1;
- QMetaObject::invokeMethod(this, [this, id] { killTimer(id); }, Qt::QueuedConnection);
- }
-
mFrameCallback = frame();
wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
mWaitingForFrameCallback = true;
@@ -1203,6 +1174,7 @@
void QWaylandWindow::deliverUpdateRequest()
{
+ qCDebug(lcWaylandBackingstore) << "deliverUpdateRequest";
mWaitingForUpdate = true;
QPlatformWindow::deliverUpdateRequest();
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index b03d92e..e4a1124 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -232,7 +232,6 @@
// True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer
bool mWaitingForUpdate = false;
- int mFallbackUpdateTimerId = -1; // Started when waiting for app to commit
QMutex mResizeLock;
bool mWaitingToApplyConfigure = false;

View File

@ -1,48 +0,0 @@
From 962b9be7992cef672cb6307af5653c97382c334f Mon Sep 17 00:00:00 2001
From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
Date: Fri, 1 Nov 2019 11:24:26 +0100
Subject: Client: Fix crash when showing a child window with a hidden parent
[ChangeLog][QPA plugin] Fixed a crash when showing a window with a hidden
parent.
Now we just avoid creating the subsurface, so nothing is shown. Seems to be
the same behavior as on xcb.
Fixes: QTBUG-79674
Change-Id: Ia46fcd9a0da5aad4704816a41515cb1e128ac65f
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 78524f6f..27e38ccf 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -109,6 +109,10 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
return nullptr;
}
+ // Make sure we don't pass NULL surfaces to libwayland (crashes)
+ Q_ASSERT(parent->object());
+ Q_ASSERT(window->object());
+
return mSubCompositor->get_subsurface(window->object(), parent->object());
}
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 8d34afd1..7098568b 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -124,9 +124,10 @@ void QWaylandWindow::initWindow()
if (shouldCreateSubSurface()) {
Q_ASSERT(!mSubSurfaceWindow);
- QWaylandWindow *p = static_cast<QWaylandWindow *>(QPlatformWindow::parent());
- if (::wl_subsurface *ss = mDisplay->createSubSurface(this, p)) {
- mSubSurfaceWindow = new QWaylandSubSurface(this, p, ss);
+ auto *parent = static_cast<QWaylandWindow *>(QPlatformWindow::parent());
+ if (parent->object()) {
+ if (::wl_subsurface *subsurface = mDisplay->createSubSurface(this, parent))
+ mSubSurfaceWindow = new QWaylandSubSurface(this, parent, subsurface);
}
} else if (shouldCreateShellSurface()) {
Q_ASSERT(!mShellSurface);

View File

@ -1,13 +0,0 @@
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index eefd048..5819763 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -85,7 +85,7 @@ QWaylandInputDevice::Keyboard::Keyboard(QWaylandInputDevice *p)
// or the server didn't send an enter event first.
return;
}
- mRepeatTimer.setInterval(mRepeatRate);
+ mRepeatTimer.setInterval(1000 / mRepeatRate);
handleKey(mRepeatKey.time, QEvent::KeyRelease, mRepeatKey.key, mRepeatKey.modifiers,
mRepeatKey.code, mRepeatKey.nativeVirtualKey, mRepeatKey.nativeModifiers,
mRepeatKey.text, true);

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
SHA512 (qtwayland-everywhere-src-5.13.2.tar.xz) = 5eb895c2ef8e2e72b71fed027f760913bf754da213e488a6103d9034170a6333f034b3488115a87a5a4e90761425487b9a8ab8e84a68e2e614c159d747408d53
SHA512 (qtwayland-everywhere-src-5.14.2.tar.xz) = 0f396cabace17f099c2f2c0be54317006dc00c5f4be08cd79a4fa4fdc94362f63cc6ce9decc7feb63f566dd2ea52d562257e4bb23332557054418fc16dc7e899