1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00
Files
guix/gnu/packages/patches/qtwayland-5.15.18-0031-client-clear-focus-on-touch-cancel.patch
Danny Milosavljevic 9d24fa2837 gnu: qtwayland@5: Add patches from KDE Qt5 Patch Collection.
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
2026-02-16 11:40:38 +01:00

117 lines
4.1 KiB
Diff

From e3ae6906a4145560d846e89e782f28c2372557dc Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Fri, 5 Aug 2022 15:00:31 +0100
Subject: [PATCH 31/55] Client: clear focus on touch cancel
When we get a touch_cancel event all touches should be treated as
lifted.
The next frame call focus is set, with no pending touch points but
without having gone through touch_up. We call mPendingTouchPoints.last()
without guards even though it is potentially now empty.
Change-Id: I3719f9507c5d397d8641692271d878076b7c23b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit dbdcd92363b44d89440dcb195d8cb9e6c34f0ddf)
---
src/client/qwaylandinputdevice.cpp | 1 +
tests/auto/client/seatv5/tst_seatv5.cpp | 30 +++++++++++++++++++++++
tests/auto/client/shared/coreprotocol.cpp | 7 ++++++
tests/auto/client/shared/coreprotocol.h | 1 +
4 files changed, 39 insertions(+)
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 2c396f35..9c764d80 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1393,6 +1393,7 @@ void QWaylandInputDevice::Touch::touch_cancel()
if (touchExt)
touchExt->touchCanceled();
+ mFocus = nullptr;
QWindowSystemInterface::handleTouchCancelEvent(nullptr, mParent->mTouchDevice);
}
diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp
index 9312c2e5..b063e0d9 100644
--- a/tests/auto/client/seatv5/tst_seatv5.cpp
+++ b/tests/auto/client/seatv5/tst_seatv5.cpp
@@ -73,6 +73,7 @@ private slots:
void multiTouch();
void multiTouchUpAndMotionFrame();
void tapAndMoveInSameFrame();
+ void cancelTouch();
};
void tst_seatv5::bindsToSeat()
@@ -646,5 +647,34 @@ void tst_seatv5::tapAndMoveInSameFrame()
QTRY_COMPARE(window.m_events.last().touchPoints.first().state(), Qt::TouchPointState::TouchPointReleased);
}
+void tst_seatv5::cancelTouch()
+{
+ TouchWindow window;
+ QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
+
+ exec([=] {
+ auto *t = touch();
+ auto *c = client();
+ t->sendDown(xdgToplevel()->surface(), {32, 32}, 1);
+ t->sendFrame(c);
+ t->sendCancel(c);
+ t->sendFrame(c);
+ });
+
+ QTRY_VERIFY(!window.m_events.empty());
+ {
+ auto e = window.m_events.takeFirst();
+ QCOMPARE(e.type, QEvent::TouchBegin);
+ QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
+ QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
+ }
+ {
+ auto e = window.m_events.takeFirst();
+ QCOMPARE(e.type, QEvent::TouchCancel);
+ QCOMPARE(e.touchPoints.length(), 0);
+ }
+}
+
QCOMPOSITOR_TEST_MAIN(tst_seatv5)
#include "tst_seatv5.moc"
diff --git a/tests/auto/client/shared/coreprotocol.cpp b/tests/auto/client/shared/coreprotocol.cpp
index 0d988521..d1a2e7cb 100644
--- a/tests/auto/client/shared/coreprotocol.cpp
+++ b/tests/auto/client/shared/coreprotocol.cpp
@@ -451,6 +451,13 @@ void Touch::sendFrame(wl_client *client)
send_frame(r->handle);
}
+void Touch::sendCancel(wl_client *client)
+{
+ const auto touchResources = resourceMap().values(client);
+ for (auto *r : touchResources)
+ send_cancel(r->handle);
+}
+
uint Keyboard::sendEnter(Surface *surface)
{
auto serial = m_seat->m_compositor->nextSerial();
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index 296dbf47..210d8ddb 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -364,6 +364,7 @@ public:
uint sendUp(wl_client *client, int id);
void sendMotion(wl_client *client, const QPointF &position, int id);
void sendFrame(wl_client *client);
+ void sendCancel(wl_client *client);
Seat *m_seat = nullptr;
};
--
2.52.0