summaryrefslogtreecommitdiffstats
path: root/synchronizer
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-04 18:13:08 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-04 18:13:08 +0200
commit97488acf72ed8ab0832e37bd33b7a02d0e9d4fef (patch)
tree5ea848dc8d4c8a269e87d2d690494931cfd59416 /synchronizer
parent322c29231f09c675a5ea2fac8346c1206bb4d5da (diff)
downloadsink-97488acf72ed8ab0832e37bd33b7a02d0e9d4fef.tar.gz
sink-97488acf72ed8ab0832e37bd33b7a02d0e9d4fef.zip
Try again to disable the dock
Diffstat (limited to 'synchronizer')
-rw-r--r--synchronizer/CMakeLists.txt3
-rw-r--r--synchronizer/main.cpp17
2 files changed, 20 insertions, 0 deletions
diff --git a/synchronizer/CMakeLists.txt b/synchronizer/CMakeLists.txt
index 9c422e6..3ea5521 100644
--- a/synchronizer/CMakeLists.txt
+++ b/synchronizer/CMakeLists.txt
@@ -15,4 +15,7 @@ target_link_libraries(${PROJECT_NAME}
15 KAsync 15 KAsync
16 ${CMAKE_DL_LIBS} 16 ${CMAKE_DL_LIBS}
17) 17)
18if(APPLE)
19 target_link_libraries(${PROJECT_NAME} "-framework CoreFoundation")
20endif()
18install(TARGETS ${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 21install(TARGETS ${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp
index 479a0bf..1a79622 100644
--- a/synchronizer/main.cpp
+++ b/synchronizer/main.cpp
@@ -38,6 +38,9 @@
38#include "log.h" 38#include "log.h"
39#include "test.h" 39#include "test.h"
40#include "definitions.h" 40#include "definitions.h"
41#ifdef Q_OS_OSX
42#include <CoreFoundation/CoreFoundation.h>
43#endif
41 44
42static Listener *listener = nullptr; 45static Listener *listener = nullptr;
43 46
@@ -226,6 +229,20 @@ int main(int argc, char *argv[])
226 229
227 qInstallMessageHandler(qtMessageHandler); 230 qInstallMessageHandler(qtMessageHandler);
228 231
232#ifdef Q_OS_OSX
233 if (CFBundleRef mainBundle = CFBundleGetMainBundle()) {
234 // get the application's Info Dictionary. For app bundles this would live in the bundle's Info.plist,
235 // for regular executables it is obtained in another way.
236 CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle);
237 if (infoDict) {
238 // Add or set the "LSUIElement" key with/to value "1". This can simply be a CFString.
239 CFDictionarySetValue(infoDict, CFSTR("LSUIElement"), CFSTR("1"));
240 // That's it. We're now considered as an "agent" by the window server, and thus will have
241 // neither menubar nor presence in the Dock or App Switcher.
242 }
243 }
244#endif
245
229 //Necessary to hide this QGuiApplication from the dock and application switcher on mac os. 246 //Necessary to hide this QGuiApplication from the dock and application switcher on mac os.
230 qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true"); 247 qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
231 QGuiApplication::setAttribute(Qt::AA_PluginApplication); 248 QGuiApplication::setAttribute(Qt::AA_PluginApplication);