From 0425be7a44fecd4e3e0f8696aaecd1d36d882ec7 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Mon, 8 Feb 2021 16:51:54 +0200 Subject: [PATCH] Remove possibility of the infinitive loop on screen capture and remove activeModalWidget check on screen capture for MacOS (cherry picked from commit afaed07ae9b3c729e6082cc6b325aeca1dc08436) --- src/core/controller.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index cbd21bb1..e388731a 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -265,14 +265,8 @@ void Controller::startVisualCapture(const uint id, #endif if (nullptr == m_captureWindow) { -#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ - defined(Q_OS_MACX)) - // It seems that the following code is not required for MacOS because it - // has another type of CaptureWidget editor (FullScreen instead Flags: - // Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Popup int timeout = 5000; // 5 seconds for (; timeout >= 0; timeout -= 10) { - qDebug() << "timeout" << timeout; QWidget* modalWidget = qApp->activeModalWidget(); if (modalWidget) { modalWidget->close(); @@ -285,8 +279,8 @@ void Controller::startVisualCapture(const uint id, if (0 == timeout) { QMessageBox::warning( nullptr, tr("Error"), tr("Unable to close active modal widgets")); + return; } -#endif m_captureWindow = new CaptureWidget(id, forcedSavePath); // m_captureWindow = new CaptureWidget(id, forcedSavePath, false); //