From ec9057081f1094fbfeb11449bc533997731e4079 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 19 Jun 2019 14:05:22 +0200 Subject: Client: Fix stuttering when the GUI thread is busy When we did invokeMethod for handling the frame callbacks, we had to wait for the GUI thread to finish whatever it's doing before we would stop blocking. Fix it by clearing the frame callback timer and stop blocking immediately, while delaying the rest of the work until it can be run on the other thread. Fixes: QTBUG-76397 Change-Id: I343e4feac4838926b4fa2ccac2948988bc6c3bb7 Reviewed-by: Paul Olav Tvete --- src/client/qwaylandwindow_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/qwaylandwindow_p.h') diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index c47123dc9..e8c9d5684 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -216,7 +216,7 @@ protected: WId mWindowId; bool mWaitingForFrameCallback = false; bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out - int mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback + QAtomicInt mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback struct ::wl_callback *mFrameCallback = nullptr; struct ::wl_event_queue *mFrameQueue = nullptr; QWaitCondition mFrameSyncWait; -- cgit v1.2.3