diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d1b9b952d4..c743b84864 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5171,19 +5171,23 @@ void Application::toggleLogDialog() { } void Application::takeSnapshot(bool notify, float aspectRatio) { - QMediaPlayer* player = new QMediaPlayer(); - QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); - player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); - player->play(); + postLambdaEvent([notify, aspectRatio, this] { + QMediaPlayer* player = new QMediaPlayer(); + QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); + player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); + player->play(); - QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio)); + QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio)); - emit DependencyManager::get()->snapshotTaken(path, notify); + emit DependencyManager::get()->snapshotTaken(path, notify); + }); } void Application::shareSnapshot(const QString& path) { - // not much to do here, everything is done in snapshot code... - Snapshot::uploadSnapshot(path); + postLambdaEvent([path] { + // not much to do here, everything is done in snapshot code... + Snapshot::uploadSnapshot(path); + }); } float Application::getRenderResolutionScale() const { diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index 5d5c39222e..4eb8c67250 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -205,13 +205,9 @@ void WindowScriptingInterface::copyToClipboard(const QString& text) { } void WindowScriptingInterface::takeSnapshot(bool notify, float aspectRatio) { - qApp->postLambdaEvent([notify, aspectRatio] { - qApp->takeSnapshot(notify, aspectRatio); - }); + qApp->takeSnapshot(notify, aspectRatio); } void WindowScriptingInterface::shareSnapshot(const QString& path) { - qApp->postLambdaEvent([path] { - qApp->shareSnapshot(path); - }); + qApp->shareSnapshot(path); }