mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
This reverts commit adb58e247b.
This commit is contained in:
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
Flameshot::Flameshot()
|
Flameshot::Flameshot()
|
||||||
: m_captureWindow(nullptr)
|
: m_captureWindow(nullptr)
|
||||||
, m_have_external_widgets(false)
|
|
||||||
#if defined(Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
, m_HotkeyScreenshotCapture(nullptr)
|
, m_HotkeyScreenshotCapture(nullptr)
|
||||||
, m_HotkeyScreenshotHistory(nullptr)
|
, m_HotkeyScreenshotHistory(nullptr)
|
||||||
@@ -412,13 +411,12 @@ void Flameshot::exportCapture(QPixmap capture,
|
|||||||
if (!(tasks & CR::UPLOAD)) {
|
if (!(tasks & CR::UPLOAD)) {
|
||||||
emit captureTaken(capture);
|
emit captureTaken(capture);
|
||||||
}
|
}
|
||||||
if (!m_have_external_widgets)
|
// hacks: close a window to trigger qt's quitOnLastWindowClose
|
||||||
qApp->quit();
|
// if not create tmp_window and close, the `flameshot gui` won't exit after
|
||||||
}
|
// click copy button
|
||||||
|
QWidget* tmp = new QWidget();
|
||||||
void Flameshot::setExternalWidgets()
|
tmp->show();
|
||||||
{
|
tmp->close();
|
||||||
m_have_external_widgets = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// STATIC ATTRIBUTES
|
// STATIC ATTRIBUTES
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ public slots:
|
|||||||
public:
|
public:
|
||||||
static void setOrigin(Origin origin);
|
static void setOrigin(Origin origin);
|
||||||
static Origin origin();
|
static Origin origin();
|
||||||
void setExternalWidgets();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void captureTaken(QPixmap p);
|
void captureTaken(QPixmap p);
|
||||||
@@ -60,7 +59,6 @@ public slots:
|
|||||||
private:
|
private:
|
||||||
Flameshot();
|
Flameshot();
|
||||||
bool resolveAnyConfigErrors();
|
bool resolveAnyConfigErrors();
|
||||||
bool m_have_external_widgets;
|
|
||||||
|
|
||||||
// class members
|
// class members
|
||||||
static Origin m_origin;
|
static Origin m_origin;
|
||||||
|
|||||||
@@ -1200,7 +1200,6 @@ void CaptureWidget::handleToolSignal(CaptureTool::Request r)
|
|||||||
w->setAttribute(Qt::WA_DeleteOnClose);
|
w->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
w->activateWindow();
|
w->activateWindow();
|
||||||
w->show();
|
w->show();
|
||||||
Flameshot::instance()->setExternalWidgets();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CaptureTool::REQ_INCREASE_TOOL_SIZE:
|
case CaptureTool::REQ_INCREASE_TOOL_SIZE:
|
||||||
|
|||||||
Reference in New Issue
Block a user