[neon/qt/qtbase/Neon/release] debian: Backport upstream patch to fix timestamp issue on QXcbConneciton.
Lisandro Damián Nicanor Pérez Meyer
null at kde.org
Thu May 5 10:59:25 BST 2022
Git commit 14f57e4da8121c8527b0f9be47a37c414ab76087 by Lisandro Damián Nicanor Pérez Meyer.
Committed on 22/09/2021 at 18:04.
Pushed by jriddell into branch 'Neon/release'.
Backport upstream patch to fix timestamp issue on QXcbConneciton.
Seems to affect applications based on GTK while running Plasma.
M +6 -0 debian/changelog
M +1 -0 debian/patches/series
A +53 -0 debian/patches/xcb_add_a_timeout_control_when_reading_INCR_property.patch
https://invent.kde.org/neon/qt/qtbase/commit/14f57e4da8121c8527b0f9be47a37c414ab76087
diff --git a/debian/changelog b/debian/changelog
index 224788d..c49d1e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,12 @@ qtbase-opensource-src (5.15.2+dfsg-11) UNRELEASED; urgency=medium
* Backport upstream patch to fix recursion crash when calling
setStyleSheet with `qproperty-styleSheet`: fix_recursion_crash.diff.
+ [ Lisandro Damián Nicanor Pérez Meyer ]
+ * Backport upstream patch
+ xcb_add_a_timeout_control_when_reading_INCR_property.patch in order to fix
+ timestamp issue on QXcbConnection,
+ https://bugreports.qt.io/browse/QTBUG-56595
+
-- Debian Janitor <janitor at jelmer.uk> Fri, 27 Aug 2021 23:06:45 -0000
qtbase-opensource-src (5.15.2+dfsg-10) unstable; urgency=medium
diff --git a/debian/patches/series b/debian/patches/series
index 60b184f..1f6ec02 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,6 +11,7 @@ fusion_checkable_qpushbutton.diff
mysql_remove_version_checks.diff
full_width_selection_rtl.diff
fix_recursion_crash.diff
+xcb_add_a_timeout_control_when_reading_INCR_property.patch
# Debian specific.
gnukfreebsd.diff
diff --git a/debian/patches/xcb_add_a_timeout_control_when_reading_INCR_property.patch b/debian/patches/xcb_add_a_timeout_control_when_reading_INCR_property.patch
new file mode 100644
index 0000000..5b090a6
--- /dev/null
+++ b/debian/patches/xcb_add_a_timeout_control_when_reading_INCR_property.patch
@@ -0,0 +1,53 @@
+From 02248eea5562c1df39ee23f195011afacc6759b0 Mon Sep 17 00:00:00 2001
+From: Liang Qi <liang.qi at qt.io>
+Date: Wed, 7 Jul 2021 13:19:14 +0200
+Subject: [PATCH] xcb: add a timeout control when reading INCR property
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+For the first call of QXcbClipboard::clipboardReadProperty()
+inside of clipboardReadIncrementalProperty() in getSelection(),
+it will get a XCB_NONE reply before the contents arrived via
+property change. Then we give a chance to read more.
+
+Manually tested with following setups:
+* examples/widgets/mainwindows/application with gvim(gtk3)
+* examples/widgets/widgets/imageviewer with GIMP 2.10.18(based on
+gtk2) and GIMP 2.99.6(based on gtk3 via flatpak)
+
+Fixes: QTBUG-56595
+Pick-to: 5.12 5.15 6.1 6.2
+Done-With: JiDe Zhang <zhangjide at uniontech.com>
+Change-Id: Ib45f08464d39ad79137b1da99808c89b7dca2d08
+Reviewed-by: JiDe Zhang <zhangjide at uniontech.com>
+Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo at qt.io>
+---
+ src/plugins/platforms/xcb/qxcbclipboard.cpp | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
++++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
+@@ -829,6 +829,8 @@ QByteArray QXcbClipboard::clipboardReadI
+ alloc_error = buf.size() != nbytes+1;
+ }
+
++ QElapsedTimer timer;
++ timer.start();
+ for (;;) {
+ connection()->flush();
+ xcb_generic_event_t *ge = waitForClipboardEvent(win, XCB_PROPERTY_NOTIFY);
+@@ -864,9 +866,11 @@ QByteArray QXcbClipboard::clipboardReadI
+ tmp_buf.resize(0);
+ offset += length;
+ }
+- } else {
+- break;
+ }
++
++ const auto elapsed = timer.elapsed();
++ if (elapsed > clipboard_timeout)
++ break;
+ }
+
+ // timed out ... create a new requestor window, otherwise the requestor
More information about the Neon-commits
mailing list