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

--- Comment #21 from antonio <antde...@gmail.com> ---
--- test/kwin-6.3.0/src/window.orig 2025-02-06 12:01:48.000000000 +0100
+++ test/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=5;
+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());

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to