From 777441ef0f064dfa38a10919d3f384907adab06b Mon Sep 17 00:00:00 2001 From: "Joakim L. Gilje" Date: Mon, 13 Dec 2021 15:19:38 +0100 Subject: [PATCH] when sleeping main emu. thread, take drawits into account like in win.c --- src/qt/qt_main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 5872b1131..2bb158f9b 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -57,8 +57,13 @@ main_thread_fn() nvr_dosave = 0; frames = 0; } - } else /* Just so we dont overload the host OS. */ - std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } else { + /* Just so we dont overload the host OS. */ + if (drawits < -1) + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + else + std::this_thread::yield(); + } /* If needed, handle a screen resize. */ if (doresize && !video_fullscreen && !is_quit) {