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:
parent
21c6fc7a8e
commit
c98f71d4c3
1 changed files with 9 additions and 7 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue