Flameshot was unable to start new captures after saving with
    Ctrl+s while having a text area active from the Text tool.
    This was caused by the overloaded call to close() which
    was deleting the text area instead of closing the capture
    and the consequent call of the destructor. That caused an
    always active capture session.
This commit is contained in:
lupoDharkael
2018-09-13 15:35:49 +02:00
parent 07fe16f8b3
commit 415b059fb2
2 changed files with 4 additions and 4 deletions

View File

@@ -186,12 +186,12 @@ QPixmap CaptureWidget::pixmap() {
return m_context.selectedScreenshotArea();
}
void CaptureWidget::close() {
void CaptureWidget::deleteToolwidgetOrClose() {
if (m_toolWidget) {
m_toolWidget->deleteLater();
m_toolWidget = nullptr;
} else {
QWidget::close();
close();
}
}
@@ -739,7 +739,7 @@ void CaptureWidget::initShortcuts() {
new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Up), this, SLOT(upResize()));
new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Down), this, SLOT(downResize()));
new QShortcut(Qt::Key_Space, this, SLOT(togglePanel()));
new QShortcut(Qt::Key_Escape, this, SLOT(close()));
new QShortcut(Qt::Key_Escape, this, SLOT(deleteToolwidgetOrClose()));
new QShortcut(Qt::Key_Return, this, SLOT(copyScreenshot()));
}