summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2019-06-23 13:25:16 +0200
committerDavid Edmundson <davidedmundson@kde.org>2019-07-01 11:13:55 +0200
commita4e6f88f50d1a1dd56df77ce8b07b98aceb20ddc (patch)
tree6e222f21e622c1f7e5925873072999173b399255
parentec9057081f1094fbfeb11449bc533997731e4079 (diff)
Client: Reset frame callback timer when hiding a window
If we hide a window whilst a compositor has a pending frame to show, it's possible the compositor will not render the frame and not return the callback. If this happens on the next window expose we can be left with mFrameCallbackTimedOut still true causing isExposed() to remain false and us to not send the next buffer when we later show the window again. Change-Id: I507410415d1a930fd5fa736412055e68fdf6c1d3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
-rw-r--r--src/client/qwaylandwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7c8ecadaa..2b243bc44 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -254,6 +254,13 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mFrameCallback = nullptr;
}
+ int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1);
+ if (timerId != -1) {
+ killTimer(timerId);
+ }
+ mWaitingForFrameCallback = false;
+ mFrameCallbackTimedOut = false;
+
mMask = QRegion();
mQueuedBuffer = nullptr;
}