Browse Source

added a property flag to audio plugin windows so that the JucePlugin_EditorRequiresKeyboardFocus flag only stops the main plugin window from getting focus, and not other pop-up windows that it might create.

tags/2021-05-28
jules 16 years ago
parent
commit
2615809676
5 changed files with 10 additions and 2 deletions
  1. +2
    -1
      build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm
  2. +1
    -0
      extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm
  3. +1
    -0
      extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp
  4. +4
    -0
      extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp
  5. +2
    -1
      juce_amalgamated.cpp

+ 2
- 1
build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm View File

@@ -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()


+ 1
- 0
extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm View File

@@ -922,6 +922,7 @@ public:
#if ! JucePlugin_EditorRequiresKeyboardFocus
setWantsKeyboardFocus (false);
#else
setComponentProperty ("juce_disallowFocus", true);
setWantsKeyboardFocus (true);
#endif
}


+ 1
- 0
extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -336,6 +336,7 @@ public:
#if JucePlugin_EditorRequiresKeyboardFocus
setWantsKeyboardFocus (true);
#else
setComponentProperty ("juce_disallowFocus", true);
setWantsKeyboardFocus (false);
#endif
setOpaque (true);


+ 4
- 0
extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp View File

@@ -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


+ 2
- 1
juce_amalgamated.cpp View File

@@ -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()


Loading…
Cancel
Save