diff options
| author | Malta Micael <[email protected]> | 2021-06-22 19:36:59 -0400 |
|---|---|---|
| committer | Malta Micael <[email protected]> | 2021-07-01 14:43:09 -0400 |
| commit | 83121eacf71214799deafda9d7730600afb42ae9 (patch) | |
| tree | 4a0f8d75b3d70e00c7b9153b07ca931f2056853b /src/qt/guiutil.cpp | |
| parent | Merge pull request #2322 from patricklodder/1.14.4-actions-win-tests (diff) | |
| download | discoin-83121eacf71214799deafda9d7730600afb42ae9.tar.xz discoin-83121eacf71214799deafda9d7730600afb42ae9.zip | |
fix: macos qt build
Diffstat (limited to 'src/qt/guiutil.cpp')
| -rw-r--r-- | src/qt/guiutil.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index cfd5b0e98..71fe49ae5 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -80,6 +80,9 @@ extern double NSAppKitVersionNumber; #if !defined(NSAppKitVersionNumber10_9) #define NSAppKitVersionNumber10_9 1265 #endif +#include <QProcess> + +void ForceActivation(); #endif namespace GUIUtil { @@ -405,6 +408,23 @@ bool isObscured(QWidget *w) && checkPoint(QPoint(w->width() / 2, w->height() / 2), w)); } +void bringToFront(QWidget* w) +{ + #ifdef Q_OS_MAC + ForceActivation(); + #endif + if (w) { + // activateWindow() (sometimes) helps with keyboard focus on Windows + if (w->isMinimized()) { + w->showNormal(); + } else { + w->show(); + } + w->activateWindow(); + w->raise(); + } +} + void openDebugLogfile() { boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; |