aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2021-07-07 19:40:10 +0100
committerGitHub <[email protected]>2021-07-07 19:40:10 +0100
commitc13e509a6c36b0cb12a7ad6c53ec257f9b0badba (patch)
tree4c1035c1bf5a1cd0cdfee862f2177c89decaab46 /src/qt/guiutil.cpp
parentMerge pull request #2343 from micaelmalta/1.14.4-dev-fix-gitian (diff)
parentfix: macos qt build (diff)
downloaddiscoin-c13e509a6c36b0cb12a7ad6c53ec257f9b0badba.tar.xz
discoin-c13e509a6c36b0cb12a7ad6c53ec257f9b0badba.zip
Merge pull request #2333 from micaelmalta/1.14.4-dev-fix-macos-gui
fix: macos qt build
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp20
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";