diff options
Diffstat (limited to 'synchronizer/main.cpp')
-rw-r--r-- | synchronizer/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 | ||
42 | static Listener *listener = nullptr; | 45 | static 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); |