diff --git a/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm b/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm index 386dae9ee5..41c7f8f6b0 100644 --- a/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm +++ b/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm @@ -1455,7 +1455,8 @@ bool NSViewComponentPeer::canBecomeKeyWindow() { // If running as a plugin, let the component decide whether it's going to allow the window to get focused. return JUCEApplication::getInstance() != 0 - || (isValidPeer (this) && getComponent()->getWantsKeyboardFocus()); + || (isValidPeer (this) + && ! getComponent()->getComponentPropertyBool ("juce_disallowFocus", false, false)); } bool NSViewComponentPeer::windowShouldClose() diff --git a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm index 8cab830368..4cc8133e31 100644 --- a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm +++ b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm @@ -922,6 +922,7 @@ public: #if ! JucePlugin_EditorRequiresKeyboardFocus setWantsKeyboardFocus (false); #else + setComponentProperty ("juce_disallowFocus", true); setWantsKeyboardFocus (true); #endif } diff --git a/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp b/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp index 61ae6dc8b6..45521b8ad0 100644 --- a/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp +++ b/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp @@ -336,6 +336,7 @@ public: #if JucePlugin_EditorRequiresKeyboardFocus setWantsKeyboardFocus (true); #else + setComponentProperty ("juce_disallowFocus", true); setWantsKeyboardFocus (false); #endif setOpaque (true); diff --git a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp index 935c57216e..8123705ed4 100644 --- a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp +++ b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp @@ -274,6 +274,10 @@ public: editor->setTopLeftPosition (0, 0); addAndMakeVisible (editor); +#if ! JucePlugin_EditorRequiresKeyboardFocus + setComponentProperty ("juce_disallowFocus", true); +#endif + #if JUCE_WIN32 addMouseListener (this, true); #endif diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 098b84fcf1..af77a4d164 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -269626,7 +269626,8 @@ bool NSViewComponentPeer::canBecomeKeyWindow() { // If running as a plugin, let the component decide whether it's going to allow the window to get focused. return JUCEApplication::getInstance() != 0 - || (isValidPeer (this) && getComponent()->getWantsKeyboardFocus()); + || (isValidPeer (this) + && ! getComponent()->getComponentPropertyBool ("juce_disallowFocus", false, false)); } bool NSViewComponentPeer::windowShouldClose()