From d13eca5a36b4da4aa7ff8ce9a15c092428122a79 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 4 Apr 2018 18:22:27 +0200 Subject: Setting the dictionary value works. --- synchronizer/main.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'synchronizer/main.cpp') diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index 1a79622..d5520f2 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp @@ -230,11 +230,10 @@ int main(int argc, char *argv[]) qInstallMessageHandler(qtMessageHandler); #ifdef Q_OS_OSX + //Necessary to hide this QGuiApplication from the dock and application switcher on mac os. if (CFBundleRef mainBundle = CFBundleGetMainBundle()) { // get the application's Info Dictionary. For app bundles this would live in the bundle's Info.plist, - // for regular executables it is obtained in another way. - CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle); - if (infoDict) { + if (CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle)) { // Add or set the "LSUIElement" key with/to value "1". This can simply be a CFString. CFDictionarySetValue(infoDict, CFSTR("LSUIElement"), CFSTR("1")); // That's it. We're now considered as an "agent" by the window server, and thus will have @@ -243,10 +242,6 @@ int main(int argc, char *argv[]) } #endif - //Necessary to hide this QGuiApplication from the dock and application switcher on mac os. - qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true"); - QGuiApplication::setAttribute(Qt::AA_PluginApplication); - QGuiApplication app(argc, argv); app.setQuitLockEnabled(false); -- cgit v1.2.3