diff -ruN kglobalaccel-5.29.0-orig/src/runtime/CMakeLists.txt kglobalaccel-5.29.0/src/runtime/CMakeLists.txt --- kglobalaccel-5.29.0-orig/src/runtime/CMakeLists.txt 2016-12-03 15:01:57.000000000 -0600 +++ kglobalaccel-5.29.0/src/runtime/CMakeLists.txt 2016-12-26 20:18:17.000000000 -0600 @@ -48,6 +48,11 @@ KF5::DBusAddons # KDBusService KF5::Crash ) +if (APPLE) + include(ECMMarkNonGuiExecutable) + ecm_mark_nongui_executable(kglobalaccel5) + target_link_libraries(kglobalaccel5 "-framework CoreFoundation") +endif() add_subdirectory(plugins) diff -ruN kglobalaccel-5.29.0-orig/src/runtime/main.cpp kglobalaccel-5.29.0/src/runtime/main.cpp --- kglobalaccel-5.29.0-orig/src/runtime/main.cpp 2016-12-03 15:01:57.000000000 -0600 +++ kglobalaccel-5.29.0/src/runtime/main.cpp 2016-12-26 20:18:17.000000000 -0600 @@ -22,6 +22,10 @@ #include "kglobalacceld.h" #include "logging_p.h" +#ifdef Q_OS_MACOS +#include +#endif + #include #include #include @@ -44,6 +48,20 @@ // get a hang on kglobalaccel restart (kglobalaccel tries to register with ksmserver, // ksmserver tries to register with kglobalaccel). qunsetenv( "SESSION_MANAGER" ); +#ifdef Q_OS_MACOS + CFBundleRef mainBundle = CFBundleGetMainBundle(); + if (mainBundle) { + // 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) { + // 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 + // neither menubar nor presence in the Dock or App Switcher. + } + } +#endif QGuiApplication app(argc, argv); KAboutData aboutdata(