Browse Source

New method: Process::setDockIconVisible()

tags/2021-05-28
jules 13 years ago
parent
commit
e864ac8109
3 changed files with 14 additions and 3 deletions
  1. +1
    -1
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  2. +7
    -2
      modules/juce_core/threads/juce_Process.h
  3. +6
    -0
      modules/juce_gui_basics/native/juce_mac_Windowing.mm

+ 1
- 1
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -138,7 +138,7 @@ struct AAXClasses
static void initialise()
{
#if JUCE_WINDOWS
PlatformUtilities::setCurrentModuleInstanceHandle (moduleInstance);
Process::setCurrentModuleInstanceHandle (moduleInstance);
#endif
initialiseJuce_GUI();


+ 7
- 2
modules/juce_core/threads/juce_Process.h View File

@@ -88,8 +88,7 @@ public:
static void lowerPrivilege();
//==============================================================================
/** Returns true if this process is being hosted by a debugger.
*/
/** Returns true if this process is being hosted by a debugger. */
static bool JUCE_CALLTYPE isRunningUnderDebugger();
@@ -130,6 +129,12 @@ public:
static void JUCE_CALLTYPE setCurrentModuleInstanceHandle (void* newHandle) noexcept;
#endif
#if JUCE_MAC || DOXYGEN
//==============================================================================
/** OSX ONLY - Shows or hides the OSX dock icon for this app. */
static void setDockIconVisible (bool isVisible);
#endif
private:
Process();
JUCE_DECLARE_NON_COPYABLE (Process);


+ 6
- 0
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

@@ -372,3 +372,9 @@ String SystemClipboard::getTextFromClipboard()
return text == nil ? String::empty
: nsStringToJuce (text);
}
void Process::setDockIconVisible (bool isVisible)
{
[NSApp setActivationPolicy: isVisible ? NSApplicationActivationPolicyRegular
: NSApplicationActivationPolicyProhibited];
}

Loading…
Cancel
Save