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:
parent
192cf67062
commit
2615809676
5 changed files with 10 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -922,6 +922,7 @@ public:
|
|||
#if ! JucePlugin_EditorRequiresKeyboardFocus
|
||||
setWantsKeyboardFocus (false);
|
||||
#else
|
||||
setComponentProperty ("juce_disallowFocus", true);
|
||||
setWantsKeyboardFocus (true);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,6 +336,7 @@ public:
|
|||
#if JucePlugin_EditorRequiresKeyboardFocus
|
||||
setWantsKeyboardFocus (true);
|
||||
#else
|
||||
setComponentProperty ("juce_disallowFocus", true);
|
||||
setWantsKeyboardFocus (false);
|
||||
#endif
|
||||
setOpaque (true);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue