mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-01-06 17:13:58 +00:00
Close modal widgets before a graphical capture
This commit is contained in:
@@ -64,6 +64,14 @@ Controller *Controller::getInstance() {
|
||||
// creation of a new capture in GUI mode
|
||||
void Controller::createVisualCapture(const uint id, const QString &forcedSavePath) {
|
||||
if (!m_captureWindow) {
|
||||
QWidget *modalWidget = nullptr;
|
||||
do {
|
||||
modalWidget = qApp->activeModalWidget();
|
||||
if (modalWidget) {
|
||||
modalWidget->close();
|
||||
modalWidget->deleteLater();
|
||||
}
|
||||
} while (modalWidget);
|
||||
m_captureWindow = new CaptureWidget(id, forcedSavePath);
|
||||
connect(m_captureWindow, &CaptureWidget::captureFailed,
|
||||
this, &Controller::captureFailed);
|
||||
|
||||
Reference in New Issue
Block a user