[neon/qt/qtwayland/Neon/release] debian/patches: manually take patches from salsa/experimental
Jonathan Esk-Riddell
null at kde.org
Wed Sep 14 09:50:34 BST 2022
Git commit cd85ce9cfc691324728c04f85c2e73fd7f397734 by Jonathan Esk-Riddell.
Committed on 14/09/2022 at 08:50.
Pushed by jriddell into branch 'Neon/release'.
manually take patches from salsa/experimental
D +0 -39 debian/patches/0010-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch
M +2 -2 debian/patches/0013-Client-Don-t-always-recreate-frame-callbacks.patch
M +3 -3 debian/patches/0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch
M +2 -2 debian/patches/0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
M +2 -2 debian/patches/0021-Client-Avoid-processing-of-events-when-showing-windo.patch
M +7 -7 debian/patches/0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch
M +2 -2 debian/patches/0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
M +2 -2 debian/patches/0029-Client-Remove-mWaitingForUpdateDelivery.patch
M +2 -2 debian/patches/0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
M +2 -2 debian/patches/0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
A +380 -0 debian/patches/0041-Only-close-popup-in-the-the-hierchary.patch
A +23 -0 debian/patches/0042-Build-fixes-for-GCC-11.patch
R +6 -2 debian/patches/0043-Check-pointer-for-null-before-use-in-ASSERT.patch [from: debian/patches/0025-Check-pointer-for-null-before-use-in-ASSERT.patch - 076% similarity]
R +6 -6 debian/patches/0044-Use-wl_surface.damage_buffer-on-the-client-side.patch [from: debian/patches/0027-Use-wl_surface.damage_buffer-on-the-client-side.patch - 093% similarity]
A +105 -0 debian/patches/0045-Client-clear-focus-on-touch-cancel.patch
A +34 -0 debian/patches/0046-Guard-mResizeDirty-by-the-correctMutex.patch
A +66 -0 debian/patches/0047-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch
R +10 -2 debian/patches/0048-Fix-compile-tests.patch [from: debian/patches/51.diff - 068% similarity]
D +0 -14 debian/patches/gcc_11.diff
M +44 -2 debian/patches/series
https://invent.kde.org/neon/qt/qtwayland/commit/cd85ce9cfc691324728c04f85c2e73fd7f397734
diff --git a/debian/patches/0010-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch b/debian/patches/0010-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch
deleted file mode 100644
index d4acd5f..0000000
--- a/debian/patches/0010-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From c7022c1c0107781993b1d13e7aa11dd3f7486249 Mon Sep 17 00:00:00 2001
-From: Aleix Pol <aleixpol at kde.org>
-Date: Tue, 13 Jul 2021 13:32:15 +0200
-Subject: [PATCH] Do not update the mask if we do not have a surface
-
-mMask serves as a cache to remember what we've sent, the source of truth
-for the value is window()->mask().
-No need to store values that we are going to discard, because it will
-confuse the state of newly created windows.
-
-Change-Id: I6aa3da82c7f09c7ef90d0f7060f292fb042730f0
-Pick-to: 5.15 6.2
-Reviewed-by: David Edmundson <davidedmundson at kde.org>
-(cherry picked from commit 962f87190c682562b369c5ebd93dc9ce0915ed7a)
----
- src/client/qwaylandwindow.cpp | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
---- a/src/client/qwaylandwindow.cpp
-+++ b/src/client/qwaylandwindow.cpp
-@@ -464,14 +464,15 @@ void QWaylandWindow::lower()
-
- void QWaylandWindow::setMask(const QRegion &mask)
- {
-+ QReadLocker locker(&mSurfaceLock);
-+ if (!mSurface)
-+ return;
-+
- if (mMask == mask)
- return;
-
- mMask = mask;
-
-- if (!mSurface)
-- return;
--
- if (mMask.isEmpty()) {
- mSurface->set_input_region(nullptr);
-
diff --git a/debian/patches/0013-Client-Don-t-always-recreate-frame-callbacks.patch b/debian/patches/0013-Client-Don-t-always-recreate-frame-callbacks.patch
index 0e7f926..3120ab0 100644
--- a/debian/patches/0013-Client-Don-t-always-recreate-frame-callbacks.patch
+++ b/debian/patches/0013-Client-Don-t-always-recreate-frame-callbacks.patch
@@ -1,4 +1,4 @@
-From abaa0b1765551533112944e624ac5989df7d7b6c Mon Sep 17 00:00:00 2001
+From aa701858908ced79f5ebe4f30907ebbe7566e238 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <gbsneto at gnome.org>
Date: Thu, 27 May 2021 19:55:04 -0300
Subject: [PATCH] Client: Don't always recreate frame callbacks
@@ -39,7 +39,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -1170,6 +1170,10 @@ void QWaylandWindow::requestUpdate()
+@@ -1185,6 +1185,10 @@ void QWaylandWindow::requestUpdate()
void QWaylandWindow::handleUpdate()
{
qCDebug(lcWaylandBackingstore) << "handleUpdate" << QThread::currentThread();
diff --git a/debian/patches/0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch b/debian/patches/0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch
index 1359e27..910c086 100644
--- a/debian/patches/0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch
+++ b/debian/patches/0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch
@@ -1,4 +1,4 @@
-From 1428e39b6e686faf4d25ab4f8506662bcc23e6f9 Mon Sep 17 00:00:00 2001
+From b9f26b7d68a39785f5bf4dbe165dcc6bec8ac144 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <gbsneto at gnome.org>
Date: Thu, 27 May 2021 20:02:53 -0300
Subject: [PATCH] Client: Always destroy frame callback in the actual callback
@@ -23,7 +23,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -622,9 +622,13 @@ void QWaylandWindow::commit()
+@@ -635,9 +635,13 @@ void QWaylandWindow::commit()
const wl_callback_listener QWaylandWindow::callbackListener = {
[](void *data, wl_callback *callback, uint32_t time) {
@@ -38,7 +38,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
window->handleFrameCallback();
}
};
-@@ -1179,11 +1183,6 @@ void QWaylandWindow::handleUpdate()
+@@ -1194,11 +1198,6 @@ void QWaylandWindow::handleUpdate()
if (!mSurface)
return;
diff --git a/debian/patches/0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch b/debian/patches/0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
index 3504642..f707007 100644
--- a/debian/patches/0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
+++ b/debian/patches/0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
@@ -1,4 +1,4 @@
-From f73a3ec466eb30e554f918d6d2da2c5d1b0e23bd Mon Sep 17 00:00:00 2001
+From 63d06271d40e53ab27457d891e7811e5ba481973 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven.car at enioka.com>
Date: Wed, 18 Aug 2021 18:28:20 +0200
Subject: [PATCH] Wayland client: use wl_keyboard to determine active state
@@ -108,7 +108,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
}
QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface)
-@@ -1083,10 +1084,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
+@@ -1098,10 +1099,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
return true;
}
diff --git a/debian/patches/0021-Client-Avoid-processing-of-events-when-showing-windo.patch b/debian/patches/0021-Client-Avoid-processing-of-events-when-showing-windo.patch
index 65be7aa..762f1d0 100644
--- a/debian/patches/0021-Client-Avoid-processing-of-events-when-showing-windo.patch
+++ b/debian/patches/0021-Client-Avoid-processing-of-events-when-showing-windo.patch
@@ -1,4 +1,4 @@
-From 340e89575c93435abab78ac73603b405f1f05ceb Mon Sep 17 00:00:00 2001
+From d9324566b1c47a9feada7c10105a5cefb49f8683 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson at kde.org>
Date: Sun, 14 Nov 2021 13:54:19 +0000
Subject: [PATCH] Client: Avoid processing of events when showing windows
@@ -23,7 +23,7 @@ Reviewed-by: Aleix Pol Gonzalez <aleixpol at kde.org>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -436,7 +436,6 @@ void QWaylandWindow::setVisible(bool visible)
+@@ -437,7 +437,6 @@ void QWaylandWindow::setVisible(bool visible)
if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
activePopups << this;
initWindow();
diff --git a/debian/patches/0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch b/debian/patches/0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch
index 2fef5ce..8ced7be 100644
--- a/debian/patches/0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch
+++ b/debian/patches/0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch
@@ -1,4 +1,4 @@
-From 967883d20e94183bd9cf6648297b9d76ba0e167e Mon Sep 17 00:00:00 2001
+From cb887d58bdf4f685f0a1f226bfbc3b2806d8ca17 Mon Sep 17 00:00:00 2001
From: Adrien Faveraux <af at brain-networks.fr>
Date: Fri, 26 Nov 2021 09:18:58 +0100
Subject: [PATCH] Move the wayland socket polling to a separate event thread
@@ -469,7 +469,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
delete mWindowDecoration;
if (mSurface)
-@@ -635,6 +632,8 @@ const wl_callback_listener QWaylandWindow::callbackListener = {
+@@ -648,6 +645,8 @@ const wl_callback_listener QWaylandWindow::callbackListener = {
void QWaylandWindow::handleFrameCallback()
{
@@ -478,7 +478,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
mWaitingForFrameCallback = false;
mFrameCallbackElapsedTimer.invalidate();
-@@ -656,12 +655,16 @@ void QWaylandWindow::handleFrameCallback()
+@@ -669,12 +668,16 @@ void QWaylandWindow::handleFrameCallback()
mWaitingForUpdateDelivery = true;
QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
}
@@ -497,7 +497,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
if (mWaitingForFrameCallback) {
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
-@@ -1157,8 +1160,11 @@ void QWaylandWindow::requestUpdate()
+@@ -1172,8 +1175,11 @@ void QWaylandWindow::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
@@ -511,7 +511,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
// If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet
// This is a somewhat redundant behavior and might indicate a bug in the calling code, so log
-@@ -1171,7 +1177,12 @@ void QWaylandWindow::requestUpdate()
+@@ -1186,7 +1192,12 @@ void QWaylandWindow::requestUpdate()
// so use invokeMethod to delay the delivery a bit.
QMetaObject::invokeMethod(this, [this] {
// Things might have changed in the meantime
@@ -525,7 +525,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
deliverUpdateRequest();
}, Qt::QueuedConnection);
}
-@@ -1191,9 +1202,10 @@ void QWaylandWindow::handleUpdate()
+@@ -1206,9 +1217,10 @@ void QWaylandWindow::handleUpdate()
if (!mSurface)
return;
@@ -538,7 +538,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
mFrameCallback = wl_surface_frame(wrappedSurface);
wl_proxy_wrapper_destroy(wrappedSurface);
wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
-@@ -1203,6 +1215,8 @@ void QWaylandWindow::handleUpdate()
+@@ -1218,6 +1230,8 @@ void QWaylandWindow::handleUpdate()
// Start a timer for handling the case when the compositor stops sending frame callbacks.
if (mFrameCallbackTimeout > 0) {
QMetaObject::invokeMethod(this, [this] {
diff --git a/debian/patches/0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch b/debian/patches/0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
index 48785cf..a657bd0 100644
--- a/debian/patches/0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
+++ b/debian/patches/0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
@@ -1,4 +1,4 @@
-From 72f64f397c72afb22df1825382e17a310517add1 Mon Sep 17 00:00:00 2001
+From 1480fda6ab4a23debd2d1a75d0e8f6c851255441 Mon Sep 17 00:00:00 2001
From: Inho Lee <inho.lee at qt.io>
Date: Mon, 1 Nov 2021 14:23:58 +0100
Subject: [PATCH] Do not create decorations when the shellSurface is not ready
@@ -22,7 +22,7 @@ Reviewed-by: Paul Olav Tvete <paul.tvete at qt.io>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -813,7 +813,7 @@ bool QWaylandWindow::createDecoration()
+@@ -828,7 +828,7 @@ bool QWaylandWindow::createDecoration()
decoration = false;
if (mSubSurfaceWindow)
decoration = false;
diff --git a/debian/patches/0029-Client-Remove-mWaitingForUpdateDelivery.patch b/debian/patches/0029-Client-Remove-mWaitingForUpdateDelivery.patch
index 6b923c4..abaf427 100644
--- a/debian/patches/0029-Client-Remove-mWaitingForUpdateDelivery.patch
+++ b/debian/patches/0029-Client-Remove-mWaitingForUpdateDelivery.patch
@@ -1,4 +1,4 @@
-From c2e56e076f0ded39b1ab34ebf07afad2f344f53f Mon Sep 17 00:00:00 2001
+From d45289232b887bad6157bb53caaa8244ee4df9e1 Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii at kde.org>
Date: Tue, 1 Feb 2022 13:05:36 +0200
Subject: [PATCH] Client: Remove mWaitingForUpdateDelivery
@@ -24,7 +24,7 @@ Reviewed-by: David Edmundson <davidedmundson at kde.org>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -648,23 +648,18 @@ void QWaylandWindow::handleFrameCallback()
+@@ -651,23 +651,18 @@ void QWaylandWindow::handleFrameCallback()
mFrameCallbackElapsedTimer.invalidate();
// The rest can wait until we can run it on the correct thread
diff --git a/debian/patches/0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch b/debian/patches/0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
index fbcc03a..5bdb6c6 100644
--- a/debian/patches/0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
+++ b/debian/patches/0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
@@ -1,4 +1,4 @@
-From 36756f5d1b8891465bddd31e990c81e149dce0f1 Mon Sep 17 00:00:00 2001
+From 29a5701dd1ac110af8a2b20a92fd1e09f8299861 Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete at qt.io>
Date: Tue, 15 Mar 2022 15:59:15 +0100
Subject: [PATCH] Revert "Client: Remove mWaitingForUpdateDelivery"
@@ -19,7 +19,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -655,11 +655,17 @@ void QWaylandWindow::handleFrameCallback()
+@@ -658,11 +658,17 @@ void QWaylandWindow::handleFrameCallback()
sendExposeEvent(QRect(QPoint(), geometry().size()));
if (wasExposed && hasPendingUpdateRequest())
deliverUpdateRequest();
diff --git a/debian/patches/0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch b/debian/patches/0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
index c9f9abf..ae1aeb2 100644
--- a/debian/patches/0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
+++ b/debian/patches/0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
@@ -1,4 +1,4 @@
-From a83e65ddc9a965b25e435d136849a50f0b99c4ae Mon Sep 17 00:00:00 2001
+From f1a4832a2db60af2110ffe4cdf9589cc06da4f59 Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete at qt.io>
Date: Tue, 15 Mar 2022 16:53:04 +0100
Subject: [PATCH] Fix race condition on mWaitingForUpdateDelivery
@@ -12,7 +12,7 @@ Reviewed-by: David Edmundson <davidedmundson at kde.org>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -649,24 +649,21 @@ void QWaylandWindow::handleFrameCallback()
+@@ -652,24 +652,21 @@ void QWaylandWindow::handleFrameCallback()
// The rest can wait until we can run it on the correct thread
auto doHandleExpose = [this]() {
diff --git a/debian/patches/0041-Only-close-popup-in-the-the-hierchary.patch b/debian/patches/0041-Only-close-popup-in-the-the-hierchary.patch
new file mode 100644
index 0000000..156a3d8
--- /dev/null
+++ b/debian/patches/0041-Only-close-popup-in-the-the-hierchary.patch
@@ -0,0 +1,380 @@
+From 6df6ff51718eda0f06c2df6edb22e8a4fc9c353e Mon Sep 17 00:00:00 2001
+From: Weng Xuetian <wengxt at gmail.com>
+Date: Wed, 20 Jul 2022 15:57:40 -0700
+Subject: [PATCH] Only close popup in the the hierchary
+
+Imagine following event sequences:
+1. a tooltip is shown. activePopups = {tooltip}
+2. user click menu bar to show the menu, QMenu::setVisible is called.
+ now activePopups(tooltip, menu}
+3. tooltip visibility changed to false.
+4. closePopups() close both tooltip and menu.
+
+This is a common pattern under wayland that menu is shown as a invisible
+state. This patch tries to memorize the surface hierchary used to create
+the popup role. And only close those popups whose ancesotor is hidden.
+
+Pick-to: 6.4
+Change-Id: I78aa0b4e32a5812603e003e756d8bcd202e94af4
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+(cherry picked from commit f8e3257e9b1e22d52e9c221c62b8d9b6dd1151a3)
+---
+ src/client/qwaylandwindow.cpp | 33 ++++---
+ src/client/qwaylandwindow_p.h | 6 ++
+ .../xdg-shell-v5/qwaylandxdgpopupv5.cpp | 5 +-
+ .../xdg-shell-v5/qwaylandxdgpopupv5_p.h | 3 +-
+ .../xdg-shell-v5/qwaylandxdgshellv5.cpp | 2 +-
+ .../xdg-shell-v6/qwaylandxdgshellv6.cpp | 3 +
+ .../xdg-shell/qwaylandxdgshell.cpp | 22 +++--
+ .../xdg-shell/qwaylandxdgshell_p.h | 5 +-
+ tests/auto/client/xdgshell/tst_xdgshell.cpp | 87 +++++++++++++++++++
+ 9 files changed, 136 insertions(+), 30 deletions(-)
+
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -239,6 +239,7 @@ bool QWaylandWindow::shouldCreateSubSurface() const
+
+ void QWaylandWindow::reset()
+ {
++ closeChildPopups();
+ delete mShellSurface;
+ mShellSurface = nullptr;
+ delete mSubSurfaceWindow;
+@@ -397,21 +398,6 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect)
+ mLastExposeGeometry = rect;
+ }
+
+-
+-static QVector<QPointer<QWaylandWindow>> activePopups;
+-
+-void QWaylandWindow::closePopups(QWaylandWindow *parent)
+-{
+- while (!activePopups.isEmpty()) {
+- auto popup = activePopups.takeLast();
+- if (popup.isNull())
+- continue;
+- if (popup.data() == parent)
+- return;
+- popup->reset();
+- }
+-}
+-
+ QPlatformScreen *QWaylandWindow::calculateScreenFromSurfaceEvents() const
+ {
+ QReadLocker lock(&mSurfaceLock);
+@@ -431,8 +417,6 @@ void QWaylandWindow::setVisible(bool visible)
+ lastVisible = visible;
+
+ if (visible) {
+- if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
+- activePopups << this;
+ initWindow();
+
+ setGeometry(windowGeometry());
+@@ -441,7 +425,6 @@ void QWaylandWindow::setVisible(bool visible)
+ // QWaylandShmBackingStore::beginPaint().
+ } else {
+ sendExposeEvent(QRect());
+- closePopups(this);
+ reset();
+ }
+ }
+@@ -1290,6 +1273,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea)
+ wl_region_destroy(region);
+ }
+
++void QWaylandWindow::addChildPopup(QWaylandWindow *surface) {
++ mChildPopups.append(surface);
++}
++
++void QWaylandWindow::removeChildPopup(QWaylandWindow *surface) {
++ mChildPopups.removeAll(surface);
++}
++
++void QWaylandWindow::closeChildPopups() {
++ while (!mChildPopups.isEmpty()) {
++ auto popup = mChildPopups.takeLast();
++ popup->reset();
++ }
++}
+ }
+
+ QT_END_NAMESPACE
+--- a/src/client/qwaylandwindow_p.h
++++ b/src/client/qwaylandwindow_p.h
+@@ -207,6 +207,10 @@ public:
+ void handleUpdate();
+ void deliverUpdateRequest() override;
+
++ void addChildPopup(QWaylandWindow* child);
++ void removeChildPopup(QWaylandWindow* child);
++ void closeChildPopups();
++
+ public slots:
+ void applyConfigure();
+
+@@ -262,6 +266,8 @@ protected:
+ QWaylandBuffer *mQueuedBuffer = nullptr;
+ QRegion mQueuedBufferDamage;
+
++ QList<QPointer<QWaylandWindow>> mChildPopups;
++
+ private:
+ void setGeometry_helper(const QRect &rect);
+ void initWindow();
+--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp
++++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp
+@@ -47,18 +47,21 @@ QT_BEGIN_NAMESPACE
+
+ namespace QtWaylandClient {
+
+-QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window)
++QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window)
+ : QWaylandShellSurface(window)
+ , QtWayland::xdg_popup_v5(popup)
++ , m_parent(parent)
+ , m_window(window)
+ {
+ if (window->display()->windowExtension())
+ m_extendedWindow = new QWaylandExtendedSurface(window);
++ m_parent->addChildPopup(m_window);
+ }
+
+ QWaylandXdgPopupV5::~QWaylandXdgPopupV5()
+ {
+ xdg_popup_destroy(object());
++ m_parent->removeChildPopup(m_window);
+ delete m_extendedWindow;
+ }
+
+--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h
++++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h
+@@ -70,7 +70,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgPopupV5 : public QWaylandShellSurface
+ {
+ Q_OBJECT
+ public:
+- QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window);
++ QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window);
+ ~QWaylandXdgPopupV5() override;
+
+ protected:
+@@ -78,6 +78,7 @@ protected:
+
+ private:
+ QWaylandExtendedSurface *m_extendedWindow = nullptr;
++ QWaylandWindow *m_parent = nullptr;
+ QWaylandWindow *m_window = nullptr;
+ };
+
+--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp
++++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp
+@@ -84,7 +84,7 @@ QWaylandXdgPopupV5 *QWaylandXdgShellV5::createXdgPopup(QWaylandWindow *window, Q
+ int x = position.x() + parentWindow->frameMargins().left();
+ int y = position.y() + parentWindow->frameMargins().top();
+
+- auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), window);
++ auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), parentWindow, window);
+ m_popups.append(window);
+ QObject::connect(popup, &QWaylandXdgPopupV5::destroyed, [this, window](){
+ m_popups.removeOne(window);
+--- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
++++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
+@@ -174,6 +174,7 @@ QWaylandXdgSurfaceV6::Popup::Popup(QWaylandXdgSurfaceV6 *xdgSurface, QWaylandXdg
+ , m_xdgSurface(xdgSurface)
+ , m_parent(parent)
+ {
++ m_parent->window()->addChildPopup(m_xdgSurface->window());
+ }
+
+ QWaylandXdgSurfaceV6::Popup::~Popup()
+@@ -181,6 +182,8 @@ QWaylandXdgSurfaceV6::Popup::~Popup()
+ if (isInitialized())
+ destroy();
+
++ m_parent->window()->removeChildPopup(m_xdgSurface->window());
++
+ if (m_grabbing) {
+ auto *shell = m_xdgSurface->m_shell;
+ Q_ASSERT(shell->m_topmostGrabbingPopup == this);
+--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+@@ -195,12 +195,17 @@ QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResi
+ | ((edges & Qt::RightEdge) ? resize_edge_right : 0));
+ }
+
+-QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent,
++QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent,
+ QtWayland::xdg_positioner *positioner)
+- : xdg_popup(xdgSurface->get_popup(parent->object(), positioner->object()))
+- , m_xdgSurface(xdgSurface)
++ : m_xdgSurface(xdgSurface)
++ , m_parentXdgSurface(qobject_cast<QWaylandXdgSurface *>(parent->shellSurface()))
+ , m_parent(parent)
+ {
++
++ init(xdgSurface->get_popup(m_parentXdgSurface ? m_parentXdgSurface->object() : nullptr, positioner->object()));
++ if (m_parent) {
++ m_parent->addChildPopup(m_xdgSurface->window());
++ }
+ }
+
+ QWaylandXdgSurface::Popup::~Popup()
+@@ -208,10 +213,14 @@ QWaylandXdgSurface::Popup::~Popup()
+ if (isInitialized())
+ destroy();
+
++ if (m_parent) {
++ m_parent->removeChildPopup(m_xdgSurface->window());
++ }
++
+ if (m_grabbing) {
+ auto *shell = m_xdgSurface->m_shell;
+ Q_ASSERT(shell->m_topmostGrabbingPopup == this);
+- shell->m_topmostGrabbingPopup = m_parent->m_popup;
++ shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr;
+ }
+ }
+
+@@ -392,8 +401,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
+ {
+ Q_ASSERT(!m_toplevel && !m_popup);
+
+- auto parentXdgSurface = static_cast<QWaylandXdgSurface *>(parent->shellSurface());
+-
+ auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner());
+ // set_popup expects a position relative to the parent
+ QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
+@@ -406,8 +413,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
+ positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left);
+ positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
+ positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
+- m_popup = new Popup(this, parentXdgSurface, positioner);
++ m_popup = new Popup(this, parent, positioner);
+ positioner->destroy();
++
+ delete positioner;
+ }
+
+--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+@@ -131,14 +131,15 @@ private:
+
+ class Popup : public QtWayland::xdg_popup {
+ public:
+- Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent, QtWayland::xdg_positioner *positioner);
++ Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent, QtWayland::xdg_positioner *positioner);
+ ~Popup() override;
+
+ void grab(QWaylandInputDevice *seat, uint serial);
+ void xdg_popup_popup_done() override;
+
+ QWaylandXdgSurface *m_xdgSurface = nullptr;
+- QWaylandXdgSurface *m_parent = nullptr;
++ QWaylandXdgSurface *m_parentXdgSurface = nullptr;
++ QWaylandWindow *m_parent = nullptr;
+ bool m_grabbing = false;
+ };
+
+--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
++++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
+@@ -46,6 +46,7 @@ private slots:
+ void configureStates();
+ void popup();
+ void tooltipOnPopup();
++ void tooltipAndSiblingPopup();
+ void switchPopups();
+ void hidePopupParent();
+ void pongs();
+@@ -346,6 +347,92 @@ void tst_xdgshell::tooltipOnPopup()
+ QCOMPOSITOR_TRY_COMPARE(xdgPopup(0), nullptr);
+ }
+
++void tst_xdgshell::tooltipAndSiblingPopup()
++{
++ class ToolTip : public QRasterWindow {
++ public:
++ explicit ToolTip(QWindow *parent) {
++ setTransientParent(parent);
++ setFlags(Qt::ToolTip);
++ resize(100, 100);
++ show();
++ }
++ void mousePressEvent(QMouseEvent *event) override {
++ QRasterWindow::mousePressEvent(event);
++ m_popup = new QRasterWindow;
++ m_popup->setTransientParent(transientParent());
++ m_popup->setFlags(Qt::Popup);
++ m_popup->resize(100, 100);
++ m_popup->show();
++ }
++
++ QRasterWindow *m_popup = nullptr;
++ };
++
++ class Window : public QRasterWindow {
++ public:
++ void mousePressEvent(QMouseEvent *event) override {
++ QRasterWindow::mousePressEvent(event);
++ m_tooltip = new ToolTip(this);
++ }
++ ToolTip *m_tooltip = nullptr;
++ };
++
++ Window window;
++ window.resize(200, 200);
++ window.show();
++
++ QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
++ exec([=] { xdgToplevel()->sendCompleteConfigure(); });
++ QCOMPOSITOR_TRY_VERIFY(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial);
++
++ exec([=] {
++ auto *surface = xdgToplevel()->surface();
++ auto *p = pointer();
++ auto *c = client();
++ p->sendEnter(surface, {100, 100});
++ p->sendFrame(c);
++ p->sendButton(client(), BTN_LEFT, Pointer::button_state_pressed);
++ p->sendButton(client(), BTN_LEFT, Pointer::button_state_released);
++ p->sendFrame(c);
++ p->sendLeave(surface);
++ p->sendFrame(c);
++ });
++
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup());
++ exec([=] { xdgPopup()->sendCompleteConfigure(QRect(100, 100, 100, 100)); });
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup()->m_xdgSurface->m_committedConfigureSerial);
++ QCOMPOSITOR_TRY_VERIFY(!xdgPopup()->m_grabbed);
++
++ exec([=] {
++ auto *surface = xdgPopup()->surface();
++ auto *p = pointer();
++ auto *c = client();
++ p->sendEnter(surface, {100, 100});
++ p->sendFrame(c);
++ p->sendButton(client(), BTN_LEFT, Pointer::button_state_pressed);
++ p->sendButton(client(), BTN_LEFT, Pointer::button_state_released);
++ p->sendFrame(c);
++ });
++
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1));
++ exec([=] { xdgPopup(1)->sendCompleteConfigure(QRect(100, 100, 100, 100)); });
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1)->m_xdgSurface->m_committedConfigureSerial);
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1)->m_grabbed);
++
++ // Close the middle tooltip (it should not close the sibling popup)
++ window.m_tooltip->close();
++
++ QCOMPOSITOR_TRY_COMPARE(xdgPopup(1), nullptr);
++ // Verify the remaining xdg surface is a grab popup..
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup(0));
++ QCOMPOSITOR_TRY_VERIFY(xdgPopup(0)->m_grabbed);
++
++ window.m_tooltip->m_popup->close();
++ QCOMPOSITOR_TRY_COMPARE(xdgPopup(1), nullptr);
++ QCOMPOSITOR_TRY_COMPARE(xdgPopup(0), nullptr);
++}
++
+ // QTBUG-65680
+ void tst_xdgshell::switchPopups()
+ {
diff --git a/debian/patches/0042-Build-fixes-for-GCC-11.patch b/debian/patches/0042-Build-fixes-for-GCC-11.patch
new file mode 100644
index 0000000..9804d22
--- /dev/null
+++ b/debian/patches/0042-Build-fixes-for-GCC-11.patch
@@ -0,0 +1,23 @@
+From e501ed58dbe44492a085587d1746a5848ac962f7 Mon Sep 17 00:00:00 2001
+From: Ville Voutilainen <ville.voutilainen at qt.io>
+Date: Mon, 18 Jan 2021 12:31:31 +0200
+Subject: [PATCH] Build fixes for GCC 11
+
+Task-number: QTBUG-89977
+Change-Id: I7e3d0964087865e8062f539f851a61f3df017dae
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+(cherry picked from commit 1aa6ec2c778504d96543f6cdc2b9199a7b066fc1)
+---
+ tests/auto/client/shared/corecompositor.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tests/auto/client/shared/corecompositor.cpp
++++ b/tests/auto/client/shared/corecompositor.cpp
+@@ -27,6 +27,7 @@
+ ****************************************************************************/
+
+ #include "corecompositor.h"
++#include <thread>
+
+ namespace MockCompositor {
+
diff --git a/debian/patches/0025-Check-pointer-for-null-before-use-in-ASSERT.patch b/debian/patches/0043-Check-pointer-for-null-before-use-in-ASSERT.patch
similarity index 76%
rename from debian/patches/0025-Check-pointer-for-null-before-use-in-ASSERT.patch
rename to debian/patches/0043-Check-pointer-for-null-before-use-in-ASSERT.patch
index e069641..4a11a97 100644
--- a/debian/patches/0025-Check-pointer-for-null-before-use-in-ASSERT.patch
+++ b/debian/patches/0043-Check-pointer-for-null-before-use-in-ASSERT.patch
@@ -1,4 +1,4 @@
-From 520f58c24e0fbb33f84f329fc9879b72710c77ae Mon Sep 17 00:00:00 2001
+From bada05134c79c9aa35ce898ec294e11a2aff949a Mon Sep 17 00:00:00 2001
From: Roman Genkhel <roman.genhel at lge.com>
Date: Thu, 12 Nov 2020 12:21:51 +0300
Subject: [PATCH] Check pointer for null before use in ASSERT
@@ -13,11 +13,15 @@ Reviewed-by: David Edmundson <davidedmundson at kde.org>
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -552,8 +552,8 @@ void QWaylandWindow::sendRecursiveExposeEvent()
+@@ -536,12 +536,12 @@ void QWaylandWindow::sendRecursiveExposeEvent()
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
{
- Q_ASSERT(!buffer->committed());
+ QReadLocker locker(&mSurfaceLock);
+ if (mSurface == nullptr)
+ return;
+
if (buffer) {
+ Q_ASSERT(!buffer->committed());
handleUpdate();
diff --git a/debian/patches/0027-Use-wl_surface.damage_buffer-on-the-client-side.patch b/debian/patches/0044-Use-wl_surface.damage_buffer-on-the-client-side.patch
similarity index 93%
rename from debian/patches/0027-Use-wl_surface.damage_buffer-on-the-client-side.patch
rename to debian/patches/0044-Use-wl_surface.damage_buffer-on-the-client-side.patch
index 9f100f9..c6691ac 100644
--- a/debian/patches/0027-Use-wl_surface.damage_buffer-on-the-client-side.patch
+++ b/debian/patches/0044-Use-wl_surface.damage_buffer-on-the-client-side.patch
@@ -1,4 +1,4 @@
-From 6935647966b456e760745a6b2a13a04ba6543803 Mon Sep 17 00:00:00 2001
+From 5972e1c4eccb1baf89d6cf779925eb35a49a8d2d Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete at qt.io>
Date: Mon, 6 Jul 2020 14:37:35 +0200
Subject: [PATCH] Use wl_surface.damage_buffer on the client side
@@ -21,7 +21,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
-@@ -488,7 +488,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
+@@ -491,7 +491,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
if (interface == QStringLiteral("wl_output")) {
mWaitingScreens << new QWaylandScreen(this, version, id);
} else if (interface == QStringLiteral("wl_compositor")) {
@@ -32,10 +32,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
mShm.reset(new QWaylandShm(this, version, id));
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
-@@ -571,7 +571,11 @@ void QWaylandWindow::attachOffset(QWaylandBuffer *buffer)
+@@ -563,7 +563,11 @@ void QWaylandWindow::damage(const QRect &rect)
+ if (mSurface == nullptr)
+ return;
- void QWaylandWindow::damage(const QRect &rect)
- {
- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
+ const int s = scale();
+ if (mDisplay->compositorVersion() >= 4)
@@ -45,7 +45,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
}
void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
-@@ -605,8 +609,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
+@@ -599,8 +603,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
return;
attachOffset(buffer);
diff --git a/debian/patches/0045-Client-clear-focus-on-touch-cancel.patch b/debian/patches/0045-Client-clear-focus-on-touch-cancel.patch
new file mode 100644
index 0000000..27ec2ae
--- /dev/null
+++ b/debian/patches/0045-Client-clear-focus-on-touch-cancel.patch
@@ -0,0 +1,105 @@
+From c618467da4c06528537026e2b78f92265bce446f Mon Sep 17 00:00:00 2001
+From: David Edmundson <davidedmundson at kde.org>
+Date: Fri, 5 Aug 2022 15:00:31 +0100
+Subject: [PATCH] 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 at qt.io>
+Reviewed-by: Liang Qi <liang.qi at qt.io>
+Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at 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(+)
+
+--- a/src/client/qwaylandinputdevice.cpp
++++ b/src/client/qwaylandinputdevice.cpp
+@@ -1388,6 +1388,7 @@ void QWaylandInputDevice::Touch::touch_cancel()
+ if (touchExt)
+ touchExt->touchCanceled();
+
++ mFocus = nullptr;
+ QWindowSystemInterface::handleTouchCancelEvent(nullptr, mParent->mTouchDevice);
+ }
+
+--- 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"
+--- 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();
+--- 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;
+ };
diff --git a/debian/patches/0046-Guard-mResizeDirty-by-the-correctMutex.patch b/debian/patches/0046-Guard-mResizeDirty-by-the-correctMutex.patch
new file mode 100644
index 0000000..52d6803
--- /dev/null
+++ b/debian/patches/0046-Guard-mResizeDirty-by-the-correctMutex.patch
@@ -0,0 +1,34 @@
+From 566f577ee2b0fa1f13bcc1a3cda64b75dbc1b3df Mon Sep 17 00:00:00 2001
+From: David Edmundson <davidedmundson at kde.org>
+Date: Thu, 3 Feb 2022 19:42:33 +0000
+Subject: [PATCH] Guard mResizeDirty by the correctMutex
+
+mResizeDirty is used in the GUI thread in setCanResize which can be
+called from the GUI thread. It is queried and set whilst the resizeLock
+is held. We need to guard our usage.
+
+Change-Id: I5f8dcf8aa2cb2c4bb6274103df1da9e3e268605a
+Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
+(cherry picked from commit 4ac96662c936821efff2875bbe555b40612caf8a)
+---
+ src/client/qwaylandwindow.cpp | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -358,11 +358,12 @@ void QWaylandWindow::setGeometry(const QRect &rect)
+ if (mWindowDecoration)
+ mWindowDecoration->update();
+
+- if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize)
++ if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize) {
++ QMutexLocker lock(&mResizeLock);
+ mResizeDirty = true;
+- else
++ } else {
+ QWindowSystemInterface::handleGeometryChange(window(), geometry());
+-
++ }
+ mSentInitialResize = true;
+ }
+ QRect exposeGeometry(QPoint(), geometry().size());
diff --git a/debian/patches/0047-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch b/debian/patches/0047-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch
new file mode 100644
index 0000000..554f12d
--- /dev/null
+++ b/debian/patches/0047-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch
@@ -0,0 +1,66 @@
+From 489a0a1fc1db61f46e2b232ae4523723a05304b7 Mon Sep 17 00:00:00 2001
+From: Liang Qi <liang.qi at qt.io>
+Date: Fri, 11 Mar 2022 09:17:25 +0100
+Subject: [PATCH] client: Synthesize enter/leave event for popup in xdg-shell
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: QTBUG-100148
+Pick-to: 6.3 6.2 5.15
+Change-Id: I45e3156d7942cff9968674c0b253d15be7235921
+Reviewed-by: Tang Haixiang <tanghaixiang at uniontech.com>
+Reviewed-by: Qt CI Bot <qt_ci_bot at qt-project.org>
+Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo at qt.io>
+(cherry picked from commit 73d35d3117722cef8e94f0d2036c56ad0a5ddae9)
+
+* asturmlechner 2022-09-08: Resolve conflict with dev branch commits
+ b6a3a938abd4a7fdb7ea96a38485b53f394fba17 and
+ f8e3257e9b1e22d52e9c221c62b8d9b6dd1151a3
+---
+ .../xdg-shell/qwaylandxdgshell.cpp | 27 +++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+@@ -221,6 +221,16 @@ QWaylandXdgSurface::Popup::~Popup()
+ auto *shell = m_xdgSurface->m_shell;
+ Q_ASSERT(shell->m_topmostGrabbingPopup == this);
+ shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr;
++ m_grabbing = false;
++
++ // Synthesize Qt enter/leave events for popup
++ QWindow *leave = nullptr;
++ if (m_xdgSurface && m_xdgSurface->window())
++ leave = m_xdgSurface->window()->window();
++ QWindowSystemInterface::handleLeaveEvent(leave);
++
++ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos()))
++ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
+ }
+ }
+
+@@ -437,6 +447,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic
+ }
+ setPopup(parent);
+ m_popup->grab(device, serial);
++
++ // Synthesize Qt enter/leave events for popup
++ if (!parent)
++ return;
++ QWindow *current = QGuiApplication::topLevelAt(QCursor::pos());
++ QWindow *leave = parent->window();
++ if (current != leave)
++ return;
++
++ QWindowSystemInterface::handleLeaveEvent(leave);
++
++ QWindow *enter = nullptr;
++ if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window())
++ enter = m_popup->m_xdgSurface->window()->window();
++
++ if (enter)
++ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
+ }
+
+ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial)
diff --git a/debian/patches/51.diff b/debian/patches/0048-Fix-compile-tests.patch
similarity index 68%
rename from debian/patches/51.diff
rename to debian/patches/0048-Fix-compile-tests.patch
index 46589d3..495127c 100644
--- a/debian/patches/51.diff
+++ b/debian/patches/0048-Fix-compile-tests.patch
@@ -1,5 +1,13 @@
-diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp
-index b063e0d93c05437bf93fed0b7224f2db5fff26fd..2ea382f1c044e2f97684f6477ea564387e655bfb 100644
+From f77065f0cc9da073535e7347eac1ee150dde1908 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid at kde.org>
+Date: Fri, 9 Sep 2022 15:37:49 +0200
+Subject: [PATCH] Fix compile tests
+
+Broken in c618467da4c06528537026e2b78f92265bce446f
+---
+ tests/auto/client/seatv5/tst_seatv5.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
--- a/tests/auto/client/seatv5/tst_seatv5.cpp
+++ b/tests/auto/client/seatv5/tst_seatv5.cpp
@@ -665,9 +665,9 @@ void tst_seatv5::cancelTouch()
diff --git a/debian/patches/gcc_11.diff b/debian/patches/gcc_11.diff
deleted file mode 100644
index 5615940..0000000
--- a/debian/patches/gcc_11.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-Description: build fixes for GCC 11
-Origin: upstream, https://code.qt.io/cgit/qt/qtwayland.git/commit/?id=1aa6ec2c778504d9
-Last-Update: 2021-08-10
-
---- a/tests/auto/client/shared/corecompositor.cpp
-+++ b/tests/auto/client/shared/corecompositor.cpp
-@@ -27,6 +27,7 @@
- ****************************************************************************/
-
- #include "corecompositor.h"
-+#include <thread>
-
- namespace MockCompositor {
-
diff --git a/debian/patches/series b/debian/patches/series
index e0d9426..e80898d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,45 @@
+0001-Client-Announce-an-output-after-receiving-more-compl.patch
+0002-Fix-issue-with-repeated-window-size-changes.patch
+0004-Client-Connect-drags-being-accepted-to-updating-the-.patch
+0005-Client-Disconnect-registry-listener-on-destruction.patch
+0006-Client-Set-XdgShell-size-hints-before-the-first-comm.patch
+0007-Fix-build.patch
+0008-Fix-remove-listener.patch
+0009-Hook-up-queryKeyboardModifers.patch
+0011-Correctly-detect-if-image-format-is-supported-by-QIm.patch
+0012-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch
+0013-Client-Don-t-always-recreate-frame-callbacks.patch
+0014-Client-Always-destroy-frame-callback-in-the-actual-c.patch
+0015-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch
+0016-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
+0017-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch
+0018-Set-preedit-cursor-when-cursor-equals-to-0.patch
+0019-Client-Implement-DataDeviceV3.patch
+0020-Client-Delay-deletion-of-QDrag-object-until-after-we.patch
+0021-Client-Avoid-processing-of-events-when-showing-windo.patch
+0022-Handle-registry_global-out-of-constructor.patch
+0023-Connect-flushRequest-after-forceRoundTrip.patch
+0024-Move-the-wayland-socket-polling-to-a-separate-event-.patch
+0026-Do-not-create-decorations-when-the-shellSurface-is-n.patch
+0028-Fix-crash-if-no-input-method-module-could-be-loaded.patch
+0029-Client-Remove-mWaitingForUpdateDelivery.patch
+0030-Cursor-position-0-should-still-show-the-cursor.patch
+0031-Update-the-preedit-styling-mapping.patch
+0032-client-Simplify-round-trip-behavior.patch
+0033-Client-Fix-opaque-region-setter.patch
+0034-Use-proper-dependencies-in-compile-tests.patch
+0035-client-update-button-state-and-etc-in-pointer_leave.patch
+0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
+0037-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
+0038-use-poll-2-when-reading-from-clipboard.patch
+0039-Reduce-memory-leakage.patch
+0040-Fix-build-with-libcxx-missing-array-include.patch
+0041-Only-close-popup-in-the-the-hierchary.patch
+0042-Build-fixes-for-GCC-11.patch
+0043-Check-pointer-for-null-before-use-in-ASSERT.patch
+0044-Use-wl_surface.damage_buffer-on-the-client-side.patch
+0045-Client-clear-focus-on-touch-cancel.patch
+0046-Guard-mResizeDirty-by-the-correctMutex.patch
+0047-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch
+0048-Fix-compile-tests.patch
skip_animated_cursor_test.diff
-gcc_11.diff
-51.diff
More information about the Neon-commits
mailing list