1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Fix Process::setDockIconVisible() may not turn the process into a background-process

This commit is contained in:
stefan 2016-09-23 13:49:34 +01:00
parent 21c6fc7a8e
commit c98f71d4c3

View file

@ -483,13 +483,15 @@ String SystemClipboard::getTextFromClipboard()
void Process::setDockIconVisible (bool isVisible)
{
#if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
[NSApp setActivationPolicy: isVisible ? NSApplicationActivationPolicyRegular
: NSApplicationActivationPolicyProhibited];
#else
ignoreUnused (isVisible);
jassertfalse; // sorry, not available in 10.5!
#endif
ProcessSerialNumber psn { 0, kCurrentProcess };
ProcessApplicationTransformState state = isVisible
? kProcessTransformToForegroundApplication
: kProcessTransformToUIElementApplication;
OSStatus err = TransformProcessType (&psn, state);
jassert (err == 0);
ignoreUnused (err);
}
bool Desktop::isOSXDarkModeActive()