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();