On OS X restore from dock
authorA. V. Lukyanov <dukzcry@users.noreply.github.com>
Wed, 3 Aug 2016 02:16:29 +0000 (05:16 +0300)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 14 Sep 2016 21:00:56 +0000 (23:00 +0200)
CMakeLists.txt
src/uisupport/graphicalui.cpp

index e031527..b6ab772 100644 (file)
@@ -101,6 +101,9 @@ if (APPLE)
         option(WITH_NOTIFICATION_CENTER "OS X Notification Center support" ON)
         add_feature_info(WITH_NOTIFICATION_CENTER WITH_NOTIFICATION_CENTER "Use the OS X Notification Center")
     endif()
+    find_library(CARBON_LIBRARY Carbon)
+    mark_as_advanced(CARBON_LIBRARY)
+    link_libraries(${CARBON_LIBRARY})
 endif()
 
 # Always embed on Windows, OSX or for a static build; never embed when enabling KDE integration
index e79ce3f..1bdf047 100644 (file)
@@ -35,6 +35,9 @@
 #  include <KWindowInfo>
 #  include <KWindowSystem>
 #endif
+#ifdef Q_OS_MAC
+#include <Carbon/Carbon.h>
+#endif
 
 GraphicalUi *GraphicalUi::_instance = 0;
 QWidget *GraphicalUi::_mainWidget = 0;
@@ -313,9 +316,18 @@ void GraphicalUi::hideMainWidget()
     KWindowInfo info = KWindowSystem::windowInfo(mainWidget()->winId(), NET::WMDesktop | NET::WMFrameExtents);
     _onAllDesktops = info.onAllDesktops();
 #endif
+#ifdef Q_OS_MAC
+    ProcessSerialNumber pn;
+#endif
 
-    if (instance()->isHidingMainWidgetAllowed())
+    if (instance()->isHidingMainWidgetAllowed()) {
+#ifdef Q_OS_MAC
+        GetFrontProcess(&pn);
+        ShowHideProcess(&pn, false);
+#else
         mainWidget()->hide();
+#endif
+    }
 }