[neon/qt/qtwayland/Neon/unstable] debian: Add patches from KDE’s Qt 5 Patch Collection up to 2023-01-05.
Dmitry Shachnev
null at kde.org
Mon Apr 29 17:44:39 BST 2024
Git commit 34d8bb8b47bb2e4a866e810fc0f3916c6e486e08 by Dmitry Shachnev.
Committed on 06/01/2023 at 07:37.
Pushed by jriddell into branch 'Neon/unstable'.
Add patches from KDE’s Qt 5 Patch Collection up to 2023-01-05.
M +1 -0 debian/changelog
A +59 -0 debian/patches/0062-Client-Handle-zwp_primary_selection_device_manager_v.patch
A +21 -0 debian/patches/0063-Fixes-the-build-on-CentOS.patch
A +51 -0 debian/patches/0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch
M +3 -0 debian/patches/series
https://invent.kde.org/neon/qt/qtwayland/-/commit/34d8bb8b47bb2e4a866e810fc0f3916c6e486e08
diff --git a/debian/changelog b/debian/changelog
index 9460f1f..0b7499b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ qtwayland-opensource-src (5.15.8-1) UNRELEASED; urgency=medium
- 0015-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch
- 0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
* Refresh other patches.
+ * Add patches from KDE’s Qt 5 Patch Collection up to 2023-01-05.
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Fri, 06 Jan 2023 11:12:42 +0400
diff --git a/debian/patches/0062-Client-Handle-zwp_primary_selection_device_manager_v.patch b/debian/patches/0062-Client-Handle-zwp_primary_selection_device_manager_v.patch
new file mode 100644
index 0000000..dad9c30
--- /dev/null
+++ b/debian/patches/0062-Client-Handle-zwp_primary_selection_device_manager_v.patch
@@ -0,0 +1,59 @@
+From d0e8f938567f841a779d7365b8b5037037045fc5 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii at kde.org>
+Date: Tue, 27 Sep 2022 22:05:07 +0300
+Subject: [PATCH] Client: Handle zwp_primary_selection_device_manager_v1 global
+ removal
+
+The zwp_primary_selection_device_manager_v1 global can be withdrawn if
+the compositor disables the primary selection, i.e. middle click to
+paste selected text. QtWayland needs to handle that; otherwise the app
+can crash.
+
+Pick-to: 6.5
+Change-Id: Idbb4db18b605f85a5951fa12c1bdf61898b0d123
+Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
+(cherry picked from commit 45163234a4e4baad0012d3ee07501093d98ba91c)
+---
+ src/client/qwaylanddisplay.cpp | 9 +++++++++
+ src/client/qwaylandprimaryselectionv1.cpp | 5 -----
+ 2 files changed, 9 insertions(+), 5 deletions(-)
+
+--- a/src/client/qwaylanddisplay.cpp
++++ b/src/client/qwaylanddisplay.cpp
+@@ -515,6 +515,8 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
+ #if QT_CONFIG(wayland_client_primary_selection)
+ } else if (interface == QStringLiteral("zwp_primary_selection_device_manager_v1")) {
+ mPrimarySelectionManager.reset(new QWaylandPrimarySelectionDeviceManagerV1(this, id, 1));
++ for (QWaylandInputDevice *inputDevice : qAsConst(mInputDevices))
++ inputDevice->setPrimarySelectionDevice(mPrimarySelectionManager->createDevice(inputDevice));
+ #endif
+ } else if (interface == QStringLiteral("zwp_text_input_manager_v2") && !mClientSideInputContextRequested) {
+ mTextInputManager.reset(new QtWayland::zwp_text_input_manager_v2(registry, id, 1));
+@@ -573,6 +575,13 @@ void QWaylandDisplay::registry_global_remove(uint32_t id)
+ inputDevice->setTextInput(nullptr);
+ mWaylandIntegration->reconfigureInputContext();
+ }
++#if QT_CONFIG(wayland_client_primary_selection)
++ if (global.interface == QStringLiteral("zwp_primary_selection_device_manager_v1")) {
++ mPrimarySelectionManager.reset();
++ for (QWaylandInputDevice *inputDevice : qAsConst(mInputDevices))
++ inputDevice->setPrimarySelectionDevice(nullptr);
++ }
++#endif
+ mGlobals.removeAt(i);
+ break;
+ }
+--- a/src/client/qwaylandprimaryselectionv1.cpp
++++ b/src/client/qwaylandprimaryselectionv1.cpp
+@@ -54,11 +54,6 @@ QWaylandPrimarySelectionDeviceManagerV1::QWaylandPrimarySelectionDeviceManagerV1
+ : zwp_primary_selection_device_manager_v1(display->wl_registry(), id, qMin(version, uint(1)))
+ , m_display(display)
+ {
+- // Create devices for all seats.
+- // This only works if we get the global before all devices
+- const auto seats = m_display->inputDevices();
+- for (auto *seat : seats)
+- seat->setPrimarySelectionDevice(createDevice(seat));
+ }
+
+ QWaylandPrimarySelectionDeviceV1 *QWaylandPrimarySelectionDeviceManagerV1::createDevice(QWaylandInputDevice *seat)
diff --git a/debian/patches/0063-Fixes-the-build-on-CentOS.patch b/debian/patches/0063-Fixes-the-build-on-CentOS.patch
new file mode 100644
index 0000000..938b4a0
--- /dev/null
+++ b/debian/patches/0063-Fixes-the-build-on-CentOS.patch
@@ -0,0 +1,21 @@
+From 2904e1b3c3004153b49c4dabfec04cc1ff5e3284 Mon Sep 17 00:00:00 2001
+From: Aleix Pol <aleixpol at kde.org>
+Date: Mon, 19 Dec 2022 15:31:03 +0100
+Subject: [PATCH] Fixes the build on CentOS
+
+Change-Id: I3c21972e7681be99b0f45c3ea3a57be285e4ff8e
+---
+ src/client/qwaylandshmbackingstore.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/client/qwaylandshmbackingstore.cpp
++++ b/src/client/qwaylandshmbackingstore.cpp
+@@ -78,7 +78,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
+ int alloc = stride * size.height();
+ int fd = -1;
+
+-#ifdef SYS_memfd_create
++#if defined(SYS_memfd_create) && defined(F_SEAL_SEAL)
+ fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+ if (fd >= 0)
+ fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
diff --git a/debian/patches/0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch b/debian/patches/0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch
new file mode 100644
index 0000000..0ec0c10
--- /dev/null
+++ b/debian/patches/0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch
@@ -0,0 +1,51 @@
+From f6a1e838e371dc90272c62daeea597fe487dec3e Mon Sep 17 00:00:00 2001
+From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
+Date: Mon, 23 May 2022 09:47:24 +0200
+Subject: [PATCH] client: Avoid protocol error with invalid min/max size
+
+If the application sets an invalid minimum and maximum size
+(where the minimum is higher than the maximum), then we
+would blindly send this over the protocol, which is a protocol
+error according to the spec. Qt compositors will warn about
+this and ignore the size, but mainly because "but there's no
+matching error defined" according to the comment. Other
+compositors may close the connection when this happens.
+
+To avoid crashing the app based on bogus min/max size, we
+make sure we never send a maximum size which is less than
+the minimum size. This corresponds to the behavior of
+compositors which accept the size without raising an error:
+the minimum size takes precedence.
+
+Note that 0 means "no maximum size" in the protocol, so we
+cap the value before applying this logic.
+
+[ChangeLog][Client] Fixed an issue where setting an invalid
+minimum and maximum size on a window would cause some
+compositors to raise a protocol error.
+
+Pick-to: 6.2 6.3
+Fixes: QTBUG-102626
+Fixes: QTBUG-103391
+Change-Id: I4004a4550a9fe3dae6a27169b4d1a9a616e21841
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+(cherry picked from commit 487de47277ccc31891f6340ce4c971c91336d9a4)
+---
+ src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+@@ -384,10 +384,10 @@ void QWaylandXdgSurface::setSizeHints()
+ const int minHeight = qMax(0, m_window->windowMinimumSize().height());
+ m_toplevel->set_min_size(minWidth, minHeight);
+
+- int maxWidth = qMax(0, m_window->windowMaximumSize().width());
++ int maxWidth = qMax(minWidth, m_window->windowMaximumSize().width());
+ if (maxWidth == QWINDOWSIZE_MAX)
+ maxWidth = 0;
+- int maxHeight = qMax(0, m_window->windowMaximumSize().height());
++ int maxHeight = qMax(minHeight, m_window->windowMaximumSize().height());
+ if (maxHeight == QWINDOWSIZE_MAX)
+ maxHeight = 0;
+ m_toplevel->set_max_size(maxWidth, maxHeight);
diff --git a/debian/patches/series b/debian/patches/series
index abac8f0..b562f8e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -52,4 +52,7 @@
0059-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch
0060-Client-Bump-wl_output-version.patch
0061-Fix-frame-sync-related-to-unprotected-multithread-ac.patch
+0062-Client-Handle-zwp_primary_selection_device_manager_v.patch
+0063-Fixes-the-build-on-CentOS.patch
+0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch
skip_animated_cursor_test.diff
More information about the Neon-commits
mailing list