qt5-qtwayland/0007-Fix-remove-listener.patch

34 lines
1.3 KiB
Diff
Raw Normal View History

2023-06-13 07:07:13 +00:00
From 07a83b80d7c1b90146d9c6b6339bf4e730ca50b9 Mon Sep 17 00:00:00 2001
2022-03-08 11:00:00 +00:00
From: Zhang Liang <zhanglianga@uniontech.com>
Date: Mon, 1 Feb 2021 19:29:43 +0800
2023-06-13 07:07:13 +00:00
Subject: [PATCH 07/51] Fix: remove listener
2022-03-08 11:00:00 +00:00
Add the operation for removing the listener form listener list
Change-Id: Ief2ff1303b607eee499543303fe80e51f8f10cc5
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 16760280fd04cf70255bab16d9acecad254fdd8f)
---
src/client/qwaylanddisplay.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
2023-04-11 11:34:57 +00:00
index 78e387bc..280e63bd 100644
2022-03-08 11:00:00 +00:00
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
2023-04-11 11:34:57 +00:00
@@ -456,9 +456,10 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
2022-03-08 11:00:00 +00:00
void QWaylandDisplay::removeListener(RegistryListener listener, void *data)
{
- std::remove_if(mRegistryListeners.begin(), mRegistryListeners.end(), [=](Listener l){
+ auto iter = std::remove_if(mRegistryListeners.begin(), mRegistryListeners.end(), [=](Listener l){
return (l.listener == listener && l.data == data);
});
+ mRegistryListeners.erase(iter, mRegistryListeners.end());
}
uint32_t QWaylandDisplay::currentTimeMillisec()
--
2023-06-13 07:07:13 +00:00
2.40.1
2022-03-08 11:00:00 +00:00