From 9e897289b6336d3a2a61b4da9e30d7fe8836e602 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Fri, 27 Nov 2020 02:44:48 -0800 Subject: [PATCH] Raise window to the top on MacOS --- cmake/modules/MacOSXBundleInfo.plist.in | 6 ++++++ src/core/controller.cpp | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index bf1e2f76..535d1fe1 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -36,5 +36,11 @@ NSApplication NSHighResolutionCapable True + LSUIElement + 1 + NSPhotoLibraryAddUsageDescription + Application requires access to save screenshots to your gallery + NSSupportsAutomaticGraphicsSwitching + diff --git a/src/core/controller.cpp b/src/core/controller.cpp index c795bf5f..b9405685 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -156,6 +156,7 @@ void Controller::startVisualCapture(const uint id, // m_captureWindow->show(); m_captureWindow->showFullScreen(); m_captureWindow->activateWindow(); + m_captureWindow->raise(); #else m_captureWindow->showFullScreen(); #endif @@ -190,6 +191,7 @@ void Controller::openConfigWindow() #if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ defined(Q_OS_MACX)) m_configWindow->activateWindow(); + m_configWindow->raise(); #endif } } @@ -199,6 +201,11 @@ void Controller::openInfoWindow() { if (!m_infoWindow) { m_infoWindow = new InfoWindow(); +#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ + defined(Q_OS_MACX)) + m_infoWindow->activateWindow(); + m_infoWindow->raise(); +#endif } } @@ -211,6 +218,7 @@ void Controller::openLauncherWindow() #if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ defined(Q_OS_MACX)) m_launcherWindow->activateWindow(); + m_launcherWindow->raise(); #endif } @@ -337,6 +345,7 @@ void Controller::showRecentScreenshots() #if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ defined(Q_OS_MACX)) m_history->activateWindow(); + m_history->raise(); #endif }