From 951250d86cb62b98d2443101064831df2d15cf0a Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Tue, 25 Mar 2025 08:32:01 -0700 Subject: [PATCH] display window. this actually fixes the skipped frame issues --- tools/clip/application.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/clip/application.cc b/tools/clip/application.cc index 988a64bff3..9048486742 100644 --- a/tools/clip/application.cc +++ b/tools/clip/application.cc @@ -74,12 +74,18 @@ Application::Application(int argc, char *argv[], QObject *parent) : QObject(pare QObject::connect(recorderThread, &QThread::finished, recorder, &QObject::deleteLater); QObject::connect(window, &OnroadWindow::redrew, this, [&]() { - recorder->saveFrame(std::make_shared(std::move(window->grab()))); - }, Qt::DirectConnection); + QElapsedTimer timer; + timer.start(); + QPixmap pixmap = window->grab(); + // qDebug() << "pixmap took " << timer.elapsed() << " ms"; + timer.restart(); + recorder->saveFrame(std::make_shared(std::move(pixmap))); + // qDebug() << "save frame took" << timer.elapsed() << " ms"; + }, Qt::QueuedConnection); QObject::connect(app, &QCoreApplication::aboutToQuit, recorderThread, &QThread::quit); - window->setAttribute(Qt::WA_DontShowOnScreen); + // window->setAttribute(Qt::WA_DontShowOnScreen); window->setAttribute(Qt::WA_Mapped); window->setAttribute(Qt::WA_NoSystemBackground); recorderThread->start();