Dear Maintainer,

I found a patch that avoids the desktop freeze, at least until the problem is solved. Using the system I have not seen any side effects, so I think it might be useful to include it in the "kwin-wayland" package to avoid unwanted desktop freezes.

The path (see below) affects the "libkwin6_6.3.0.1-2_amd64.deb" package that contains the "/usr/lib/x86_64-linux-gnu/libkwin.so.6.3.0" library.

see also https://bugs.kde.org/show_bug.cgi?id=499913

Thanks,
Antonio


--- a/kwin-6.3.0/src/window.cpp 2025-02-06 12:01:48.000000000 +0100
+++ b/kwin-6.3.0/src/window.cpp 2025-02-21 15:06:37.885455302 +0100
@@ -50,6 +50,12 @@
 #include <QMouseEvent>
 #include <QStyleHints>

+#include <time.h>
+#include <unistd.h>
+time_t maxtime=1;
+useconds_t waitmsec=10;
+
+
 namespace KWin
 {

@@ -1542,7 +1548,9 @@
         int lastVisiblePixels = -1;
         QRectF lastTry = nextMoveResizeGeom;
         bool titleFailed = false;
-        for (;;) {
+        time_t starttime=time(NULL);
+        while((time(NULL)-starttime)<maxtime) {
+            usleep(waitmsec);
             const QRect titleRect = bTitleRect.translated(nextMoveResizeGeom.topLeft()).toRect();              const int requiredPixels = std::min(100 * (transposed ? titleRect.width() : titleRect.height()), titleRect.width() * titleRect.height());

@@ -1665,7 +1673,9 @@
         }
         bool transposed = false;
         QRectF bTitleRect = titleBarRect(nextMoveResizeGeom, transposed);
-        for (;;) {
+        time_t starttime=time(NULL);
+        while((time(NULL)-starttime)<maxtime) {
+            usleep(waitmsec);
             QRectF currentTry = nextMoveResizeGeom;
             const QRect titleRect = bTitleRect.translated(currentTry.topLeft()).toRect();              const int requiredPixels = std::min(100 * (transposed ? titleRect.width() : titleRect.height()), titleRect.width() * titleRect.height());

Reply via email to