1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

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.

This commit is contained in:
jules 2009-07-17 16:55:48 +00:00
parent 192cf67062
commit 2615809676
5 changed files with 10 additions and 2 deletions

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

View file

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

View file

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

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

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