| @@ -1479,7 +1479,7 @@ private: | |||||
| lastEventTime = eventTime; | lastEventTime = eventTime; | ||||
| [[hostWindow parentWindow] makeKeyWindow]; | [[hostWindow parentWindow] makeKeyWindow]; | ||||
| [NSApp postEvent: [NSApp currentEvent] atStart: YES]; | |||||
| repostCurrentNSEvent(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -162,7 +162,7 @@ void forwardCurrentKeyEventToHostWindow() | |||||
| if (! isJuceWindow (w)) | if (! isJuceWindow (w)) | ||||
| { | { | ||||
| ActivateWindow (w, true); | ActivateWindow (w, true); | ||||
| [NSApp postEvent: [NSApp currentEvent] atStart: YES]; | |||||
| repostCurrentNSEvent(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -254,7 +254,7 @@ bool forwardCurrentKeyEventToHost (Component* comp) | |||||
| #else | #else | ||||
| NSWindow* win = [(NSView*) comp->getWindowHandle() window]; | NSWindow* win = [(NSView*) comp->getWindowHandle() window]; | ||||
| [[win parentWindow] makeKeyWindow]; | [[win parentWindow] makeKeyWindow]; | ||||
| [NSApp postEvent: [NSApp currentEvent] atStart: YES]; | |||||
| repostCurrentNSEvent(); | |||||
| return true; | return true; | ||||
| #endif | #endif | ||||
| } | } | ||||
| @@ -29,6 +29,11 @@ using namespace juce; | |||||
| #if JUCE_MAC && ! DOXYGEN | #if JUCE_MAC && ! DOXYGEN | ||||
| #define Point juce::Point | #define Point juce::Point | ||||
| #define Component juce::Component | #define Component juce::Component | ||||
| namespace juce | |||||
| { | |||||
| void repostCurrentNSEvent(); | |||||
| } | |||||
| #endif | #endif | ||||
| extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType); | extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType); | ||||
| @@ -328,3 +328,11 @@ void MessageManager::broadcastMessage (const String& message) | |||||
| object: nil | object: nil | ||||
| userInfo: info]; | userInfo: info]; | ||||
| } | } | ||||
| // Special function used by some plugin classes to re-post carbon events | |||||
| void repostCurrentNSEvent(); | |||||
| void repostCurrentNSEvent() | |||||
| { | |||||
| NSEvent* e = [NSApp currentEvent]; | |||||
| [[NSOperationQueue mainQueue] addOperationWithBlock: ^{ [NSApp postEvent: e atStart: YES]; }]; | |||||
| } | |||||