mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-03-25 17:40:06 +00:00
fix - MacOS - Black screen when saving files with tool button key
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
#include "savetool.h"
|
||||
#include "src/utils/screenshotsaver.h"
|
||||
#include <QPainter>
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#include "src/widgets/capture/capturewidget.h"
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
#endif
|
||||
|
||||
SaveTool::SaveTool(QObject* parent)
|
||||
: AbstractActionTool(parent)
|
||||
@@ -55,6 +61,18 @@ CaptureTool* SaveTool::copy(QObject* parent)
|
||||
|
||||
void SaveTool::pressed(const CaptureContext& context)
|
||||
{
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
for (QWidget* widget : qApp->topLevelWidgets()) {
|
||||
QString className(widget->metaObject()->className());
|
||||
// if (className.compare("CaptureWidget") == 0) {
|
||||
if (className.compare(CaptureWidget::staticMetaObject.className()) ==
|
||||
0) {
|
||||
widget->showNormal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (context.savePath.isEmpty()) {
|
||||
emit requestAction(REQ_HIDE_GUI);
|
||||
bool ok = ScreenshotSaver().saveToFilesystemGUI(
|
||||
|
||||
Reference in New Issue
Block a user