mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-29 20:43:58 +02:00
9d24fa2837
The KDE Qt5 Patch Collection (kde/5.15 branch) maintains backported fixes
for Qt 5.15 that were not backported by Qt upstream. This includes a fix
for QTBUG-103391: a fatal Wayland protocol error when a QDialog's
maximumWidth is less than the minimum width required by its contents.
Qt's Wayland backend sent set_min_size and set_max_size without ensuring
max >= min, violating the xdg-shell protocol.
* gnu/packages/patches/qtwayland-5.15.18-0001-client-announce-an-output-after-receiving-more-compl.patch,
gnu/packages/patches/qtwayland-5.15.18-0002-fix-issue-with-repeated-window-size-changes.patch,
gnu/packages/patches/qtwayland-5.15.18-0003-client-connect-drags-being-accepted-to-updating-the-.patch,
gnu/packages/patches/qtwayland-5.15.18-0004-client-disconnect-registry-listener-on-destruction.patch,
gnu/packages/patches/qtwayland-5.15.18-0005-client-set-xdgshell-size-hints-before-the-first-comm.patch,
gnu/packages/patches/qtwayland-5.15.18-0006-fix-build.patch,
gnu/packages/patches/qtwayland-5.15.18-0007-fix-remove-listener.patch,
gnu/packages/patches/qtwayland-5.15.18-0008-hook-up-querykeyboardmodifers.patch,
gnu/packages/patches/qtwayland-5.15.18-0009-correctly-detect-if-image-format-is-supported-by-qim.patch,
gnu/packages/patches/qtwayland-5.15.18-0010-client-don-t-always-recreate-frame-callbacks.patch,
gnu/packages/patches/qtwayland-5.15.18-0011-client-always-destroy-frame-callback-in-the-actual-c.patch,
gnu/packages/patches/qtwayland-5.15.18-0012-wayland-client-use-wl_keyboard-to-determine-active-s.patch,
gnu/packages/patches/qtwayland-5.15.18-0013-client-do-not-empty-clipboard-when-a-new-popup-windo.patch,
gnu/packages/patches/qtwayland-5.15.18-0014-client-implement-datadevicev3.patch,
gnu/packages/patches/qtwayland-5.15.18-0015-client-delay-deletion-of-qdrag-object-until-after-we.patch,
gnu/packages/patches/qtwayland-5.15.18-0016-client-avoid-processing-of-events-when-showing-windo.patch,
gnu/packages/patches/qtwayland-5.15.18-0017-handle-registry_global-out-of-constructor.patch,
gnu/packages/patches/qtwayland-5.15.18-0018-connect-flushrequest-after-forceroundtrip.patch,
gnu/packages/patches/qtwayland-5.15.18-0019-move-the-wayland-socket-polling-to-a-separate-event-.patch,
gnu/packages/patches/qtwayland-5.15.18-0020-client-remove-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0021-client-simplify-round-trip-behavior.patch,
gnu/packages/patches/qtwayland-5.15.18-0022-client-fix-opaque-region-setter.patch,
gnu/packages/patches/qtwayland-5.15.18-0023-use-proper-dependencies-in-compile-tests.patch,
gnu/packages/patches/qtwayland-5.15.18-0024-revert-client-remove-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0025-fix-race-condition-on-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0026-use-poll-2-when-reading-from-clipboard.patch,
gnu/packages/patches/qtwayland-5.15.18-0027-reduce-memory-leakage.patch,
gnu/packages/patches/qtwayland-5.15.18-0028-only-close-popup-in-the-the-hierchary.patch,
gnu/packages/patches/qtwayland-5.15.18-0029-check-pointer-for-null-before-use-in-assert.patch,
gnu/packages/patches/qtwayland-5.15.18-0030-use-wl_surface.damage_buffer-on-the-client-side.patch,
gnu/packages/patches/qtwayland-5.15.18-0031-client-clear-focus-on-touch-cancel.patch,
gnu/packages/patches/qtwayland-5.15.18-0032-guard-mresizedirty-by-the-correctmutex.patch,
gnu/packages/patches/qtwayland-5.15.18-0033-fix-compile-tests.patch,
gnu/packages/patches/qtwayland-5.15.18-0034-call-finishdrag-in-qwaylanddatadevice-dragsourcecanc.patch,
gnu/packages/patches/qtwayland-5.15.18-0035-hold-surface-read-lock-throughout-qwaylandeglwindow-.patch,
gnu/packages/patches/qtwayland-5.15.18-0036-keep-toplevel-windows-in-the-top-left-corner-of-the-.patch,
gnu/packages/patches/qtwayland-5.15.18-0037-client-add-f_seal_shrink-seal-to-shm-backing-file.patch,
gnu/packages/patches/qtwayland-5.15.18-0038-client-call-wl_output_release-upon-qwaylandscreen-de.patch,
gnu/packages/patches/qtwayland-5.15.18-0039-client-bump-wl_output-version.patch,
gnu/packages/patches/qtwayland-5.15.18-0040-fix-frame-sync-related-to-unprotected-multithread-ac.patch,
gnu/packages/patches/qtwayland-5.15.18-0041-client-handle-zwp_primary_selection_device_manager_v.patch,
gnu/packages/patches/qtwayland-5.15.18-0042-fixes-the-build-on-centos.patch,
gnu/packages/patches/qtwayland-5.15.18-0043-client-avoid-protocol-error-with-invalid-min-max-siz.patch,
gnu/packages/patches/qtwayland-5.15.18-0044-client-fix-handling-of-qt-blankcursor.patch,
gnu/packages/patches/qtwayland-5.15.18-0045-client-force-a-roundtrip-when-an-xdgoutput-is-not-re.patch,
gnu/packages/patches/qtwayland-5.15.18-0046-destroy-frame-queue-before-display.patch,
gnu/packages/patches/qtwayland-5.15.18-0047-client-fix-crash-on-dnd-updates-after-client-facing-.patch,
gnu/packages/patches/qtwayland-5.15.18-0048-convert-cursor-bitmap-to-supported-format.patch,
gnu/packages/patches/qtwayland-5.15.18-0049-replace-scale-with-devicepixelratio-for-non-integer-.patch,
gnu/packages/patches/qtwayland-5.15.18-0050-client-fix-buffer-damage.patch,
gnu/packages/patches/qtwayland-5.15.18-0051-client-commit-the-initial-surface-state-explicitly.patch,
gnu/packages/patches/qtwayland-5.15.18-0052-tests-fix-tst_xdgshell-minmaxsize.patch,
gnu/packages/patches/qtwayland-5.15.18-0053-client-remove-some-surface-commits.patch,
gnu/packages/patches/qtwayland-5.15.18-0054-client-avoid-locking-resizing-in-qwaylandshmbackings.patch,
gnu/packages/patches/qtwayland-5.15.18-0055-bradient-use-qwaylandwindow-actual-window-title.patch: New files.
* gnu/packages/patches/qtwayland-dont-recreate-callbacks.patch,
gnu/packages/patches/qtwayland-cleanup-callbacks.patch: Delete files,
superseded by KDE patches 0010 and 0011.
* gnu/local.mk (dist_patch_DATA): Register new patches, remove old ones.
* gnu/packages/qt.scm (qtwayland-5)[source]: Replace old patches with KDE
Qt5 Patch Collection.
[arguments]<:phases>{disable-failing-tests}: Skip tst_xdgshell::minMaxSize()
test; patch 0053 removed the synchronous surface commit from
propagateSizeHints(), so the test's immediate check of the committed value
no longer works.
Fixes: guix/guix#6397
Change-Id: Ia9e890c2943c47287f73654d1654e06ba775b6f6
147 lines
5.3 KiB
Diff
147 lines
5.3 KiB
Diff
From 8455b8894ea77076656ee90ded863e14bcb288f4 Mon Sep 17 00:00:00 2001
|
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
Date: Wed, 5 May 2021 20:49:26 +0300
|
|
Subject: [PATCH 01/55] Client: Announce an output after receiving more
|
|
complete state
|
|
|
|
Output initialization is not atomic, meaning that the compositor may
|
|
process a wl_output bind request in one event loop cycle, and the
|
|
xdg_output_manager.get_xdg_output in another event loop cycle.
|
|
|
|
This means that xdg_output properties may arrive in another wl_output
|
|
done frame. Prior to xdg-output v3, that wasn't an issue because the
|
|
compositor is required to send an xdg_output.done event after sending
|
|
xdg_output properties.
|
|
|
|
Starting with v3, the compositor may choose not to send an
|
|
xdg_output.done event after sending xdg_output properties. Therefore,
|
|
as is, QtWayland may announce an output with bad logical geometry or
|
|
even worse without name assigned by the compositor.
|
|
|
|
Unfortunately, that breaks applications such as plasmashell. Plasma uses
|
|
output names as a criterion to determine what kind of contents should be
|
|
displayed on a particular output.
|
|
|
|
In order to fix the initialization sequence, this change makes every
|
|
QWaylandScreen track processed events. After all required events have
|
|
been received, the screen can be announced to the rest of Qt.
|
|
|
|
Change-Id: If5da747edd7af277ec1364cbea105c6994f47402
|
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|
(cherry picked from commit 69ea480f2e53ad4a5bbca78cde044eb8d4c48896)
|
|
|
|
Original Ticket: https://codereview.qt-project.org/c/qt/qtwayland/+/347774
|
|
CCBUG: 435124
|
|
---
|
|
src/client/qwaylandscreen.cpp | 32 +++++++++++++++++++++++---------
|
|
src/client/qwaylandscreen_p.h | 10 ++++++++--
|
|
2 files changed, 31 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
|
|
index 6cb337de..7c2d9be3 100644
|
|
--- a/src/client/qwaylandscreen.cpp
|
|
+++ b/src/client/qwaylandscreen.cpp
|
|
@@ -72,7 +72,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin
|
|
qCWarning(lcQpaWayland) << "wl_output done event not supported by compositor,"
|
|
<< "QScreen may not work correctly";
|
|
mWaylandDisplay->forceRoundTrip(); // Give the compositor a chance to send geometry etc.
|
|
- mOutputDone = true; // Fake the done event
|
|
+ mProcessedEvents |= OutputDoneEvent; // Fake the done event
|
|
maybeInitialize();
|
|
}
|
|
}
|
|
@@ -83,14 +83,25 @@ QWaylandScreen::~QWaylandScreen()
|
|
zxdg_output_v1::destroy();
|
|
}
|
|
|
|
+uint QWaylandScreen::requiredEvents() const
|
|
+{
|
|
+ uint ret = OutputDoneEvent;
|
|
+
|
|
+ if (mWaylandDisplay->xdgOutputManager()) {
|
|
+ ret |= XdgOutputNameEvent;
|
|
+
|
|
+ if (mWaylandDisplay->xdgOutputManager()->version() < 3)
|
|
+ ret |= XdgOutputDoneEvent;
|
|
+ }
|
|
+ return ret;
|
|
+}
|
|
+
|
|
void QWaylandScreen::maybeInitialize()
|
|
{
|
|
Q_ASSERT(!mInitialized);
|
|
|
|
- if (!mOutputDone)
|
|
- return;
|
|
-
|
|
- if (mWaylandDisplay->xdgOutputManager() && !mXdgOutputDone)
|
|
+ const uint requiredEvents = this->requiredEvents();
|
|
+ if ((mProcessedEvents & requiredEvents) != requiredEvents)
|
|
return;
|
|
|
|
mInitialized = true;
|
|
@@ -276,9 +287,8 @@ void QWaylandScreen::output_scale(int32_t factor)
|
|
|
|
void QWaylandScreen::output_done()
|
|
{
|
|
- mOutputDone = true;
|
|
- if (zxdg_output_v1::isInitialized() && mWaylandDisplay->xdgOutputManager()->version() >= 3)
|
|
- mXdgOutputDone = true;
|
|
+ mProcessedEvents |= OutputDoneEvent;
|
|
+
|
|
if (mInitialized) {
|
|
updateOutputProperties();
|
|
if (zxdg_output_v1::isInitialized())
|
|
@@ -339,7 +349,7 @@ void QWaylandScreen::zxdg_output_v1_done()
|
|
if (Q_UNLIKELY(mWaylandDisplay->xdgOutputManager()->version() >= 3))
|
|
qWarning(lcQpaWayland) << "zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor";
|
|
|
|
- mXdgOutputDone = true;
|
|
+ mProcessedEvents |= XdgOutputDoneEvent;
|
|
if (mInitialized)
|
|
updateXdgOutputProperties();
|
|
else
|
|
@@ -348,7 +358,11 @@ void QWaylandScreen::zxdg_output_v1_done()
|
|
|
|
void QWaylandScreen::zxdg_output_v1_name(const QString &name)
|
|
{
|
|
+ if (Q_UNLIKELY(mInitialized))
|
|
+ qWarning(lcQpaWayland) << "zxdg_output_v1.name received after output has been initialized, this is most likely a bug in the compositor";
|
|
+
|
|
mOutputName = name;
|
|
+ mProcessedEvents |= XdgOutputNameEvent;
|
|
}
|
|
|
|
void QWaylandScreen::updateXdgOutputProperties()
|
|
diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h
|
|
index df1c94f2..050cfdc0 100644
|
|
--- a/src/client/qwaylandscreen_p.h
|
|
+++ b/src/client/qwaylandscreen_p.h
|
|
@@ -116,6 +116,13 @@ public:
|
|
static QWaylandScreen *fromWlOutput(::wl_output *output);
|
|
|
|
private:
|
|
+ enum Event : uint {
|
|
+ XdgOutputDoneEvent = 0x1,
|
|
+ OutputDoneEvent = 0x2,
|
|
+ XdgOutputNameEvent = 0x4,
|
|
+ };
|
|
+ uint requiredEvents() const;
|
|
+
|
|
void output_mode(uint32_t flags, int width, int height, int refresh) override;
|
|
void output_geometry(int32_t x, int32_t y,
|
|
int32_t width, int32_t height,
|
|
@@ -148,8 +155,7 @@ private:
|
|
QSize mPhysicalSize;
|
|
QString mOutputName;
|
|
Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation;
|
|
- bool mOutputDone = false;
|
|
- bool mXdgOutputDone = false;
|
|
+ uint mProcessedEvents = 0;
|
|
bool mInitialized = false;
|
|
|
|
#if QT_CONFIG(cursor)
|
|
--
|
|
2.52.0
|
|
|