File: 0036-Revert-Client-Remove-mWaitingForUpdateDelivery.patch

package info (click to toggle)
qtwayland-opensource-src 5.15.17-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,108 kB
  • sloc: cpp: 53,691; xml: 9,462; ansic: 187; makefile: 29; sh: 5
file content (52 lines) | stat: -rw-r--r-- 2,085 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 29a5701dd1ac110af8a2b20a92fd1e09f8299861 Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Tue, 15 Mar 2022 15:59:15 +0100
Subject: [PATCH] Revert "Client: Remove mWaitingForUpdateDelivery"

The reverted commit introduces a severe performance regression
when a client window is resized while a QtQuick renderthread
animation is running.

This reverts commit feb1a5c207c13d0bf87c0d8ad039279dbf8cee9e.

Fixes: QTBUG-101726
Change-Id: Ib5b52ce06efec8c86fada1623c2af82099e57fc6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
---
 src/client/qwaylandwindow.cpp | 12 +++++++++---
 src/client/qwaylandwindow_p.h |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -658,11 +658,17 @@ void QWaylandWindow::handleFrameCallback()
             sendExposeEvent(QRect(QPoint(), geometry().size()));
         if (wasExposed && hasPendingUpdateRequest())
             deliverUpdateRequest();
+
+        mWaitingForUpdateDelivery = false;
     };
 
-    // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
-    // in the single-threaded case.
-    QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
+    if (!mWaitingForUpdateDelivery) {
+        // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
+        // in the single-threaded case.
+        mWaitingForUpdateDelivery = true;
+        QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
+    }
+
 
     mFrameSyncWait.notify_all();
 }
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -228,6 +228,7 @@ protected:
     WId mWindowId;
     bool mWaitingForFrameCallback = false;
     bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
+    bool mWaitingForUpdateDelivery = false;
     int mFrameCallbackCheckIntervalTimerId = -1;
     QElapsedTimer mFrameCallbackElapsedTimer;
     struct ::wl_callback *mFrameCallback = nullptr;