Rebase previous patch

This commit is contained in:
Jan Grulich 2022-02-01 13:59:37 +01:00
parent 5beebd7938
commit 09c2bbd0f5

View File

@ -18,39 +18,51 @@ Change-Id: I0e5a25d18d1e66c4d7683e7e972330c4d7cbbf38
--- ---
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 812373a..29e6ef6 100644 index 0415ca9..8e321b6 100644
--- a/src/client/qwaylandwindow.cpp --- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp
@@ -715,12 +715,9 @@ @@ -637,24 +637,18 @@ void QWaylandWindow::handleFrameCallback()
mWaitingForFrameCallback = false;
mFrameCallbackElapsedTimer.invalidate(); mFrameCallbackElapsedTimer.invalidate();
// The rest can wait until we can run it on the correct thread - // The rest can wait until we can run it on the correct thread
- if (!mWaitingForUpdateDelivery) { - if (!mWaitingForUpdateDelivery) {
- auto doHandleExpose = [this]() {
- bool wasExposed = isExposed();
- mFrameCallbackTimedOut = false;
- if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed?
- sendExposeEvent(QRect(QPoint(), geometry().size()));
- if (wasExposed && hasPendingUpdateRequest())
- deliverUpdateRequest();
-
- mWaitingForUpdateDelivery = false;
- };
-
- // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() - // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
- // in the single-threaded case. - // in the single-threaded case.
- mWaitingForUpdateDelivery = true; - mWaitingForUpdateDelivery = true;
- QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection); - QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
- } - }
+ auto doHandleExpose = [this]() {
+ bool wasExposed = isExposed();
+ mFrameCallbackTimedOut = false;
+ if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed?
+ sendExposeEvent(QRect(QPoint(), geometry().size()));
+ if (wasExposed && hasPendingUpdateRequest())
+ deliverUpdateRequest();
+ };
+
+ // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() + // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
+ // in the single-threaded case. + // in the single-threaded case.
+ QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection); + QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
mFrameSyncWait.notify_all(); mFrameSyncWait.notify_all();
} }
@@ -733,8 +730,6 @@
sendExposeEvent(QRect(QPoint(), geometry().size()));
if (wasExposed && hasPendingUpdateRequest())
deliverUpdateRequest();
-
- mWaitingForUpdateDelivery = false;
}
bool QWaylandWindow::waitForFrameSync(int timeout)
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index d64c80c..6eb8053 100644 index 990e46b..2b17f89 100644
--- a/src/client/qwaylandwindow_p.h --- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h
@@ -280,7 +280,6 @@ @@ -240,7 +240,6 @@ protected:
WId mWindowId; WId mWindowId;
bool mWaitingForFrameCallback = false; bool mWaitingForFrameCallback = false;
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out