summaryrefslogtreecommitdiff
path: root/kde-frameworks/kguiaddons/files/kguiaddons-6.29.0-fix-kdeconnect-100pc-load.patch
blob: d4d3e6ab0fd37a06e818f7b544750fb0c6ed65cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 2df40937d8383c4b7db12f62827ca6f31efe20db Mon Sep 17 00:00:00 2001
From: David Redondo <kde@david-redondo.de>
Date: Tue, 21 Jul 2026 09:40:18 +0200
Subject: [PATCH] waylandclipboard: Check isInterruptionRequested in prepare
 read loop

When there's an error on the wl_display like on reconnect it can be
that there are still pending messages on the connection.
wl_display_prepare_read_queue does not check the error on the wl_display
and return -1. However wl_display_dispatch_queue_pending checks the
error and  noops. This causes the loop to never terminate. Check
if the main thread wants us to stop also in this inner loop as a fix.
BUG:517743
---
 src/systemclipboard/waylandclipboard.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/systemclipboard/waylandclipboard.cpp b/src/systemclipboard/waylandclipboard.cpp
index 5868a1c..1eaacf9 100644
--- a/src/systemclipboard/waylandclipboard.cpp
+++ b/src/systemclipboard/waylandclipboard.cpp
@@ -552,7 +552,7 @@ public:
     void run() override
     {
         while (!isInterruptionRequested()) {
-            while (wl_display_prepare_read_queue(m_display, m_queue) != 0) {
+            while (!isInterruptionRequested() && wl_display_prepare_read_queue(m_display, m_queue) != 0) {
                 QMutexLocker lock(&s_clipboardLock);
                 wl_display_dispatch_queue_pending(m_display, m_queue);
             }
-- 
GitLab