From a5b55ab9025abf24bb4d08e2e85b74a8fca2c0a4 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 31 May 2022 19:01:32 +0100 Subject: [PATCH] VST(3) Host: Use standard (non-flipped) coordinate space for plugin editors This change fixes an issue where UAD VST2 plugins would incorrectly draw a menu at the top, rather than at the bottom, of the editor view. --- .../juce_audio_processors.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index f858f91d07..e4e001eccd 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -155,21 +155,19 @@ private: } } - struct FlippedNSView : public ObjCClass + struct InnerNSView : public ObjCClass { - FlippedNSView() - : ObjCClass ("JuceFlippedNSView_") + InnerNSView() + : ObjCClass ("JuceInnerNSView_") { addIvar ("owner"); - addMethod (@selector (isFlipped), isFlipped); addMethod (@selector (isOpaque), isOpaque); addMethod (@selector (didAddSubview:), didAddSubview); registerClass(); } - static BOOL isFlipped (id, SEL) { return YES; } static BOOL isOpaque (id, SEL) { return YES; } static void nudge (id self) @@ -179,15 +177,12 @@ private: owner->triggerAsyncUpdate(); } - static void viewDidUnhide (id self, SEL) { nudge (self); } static void didAddSubview (id self, SEL, NSView*) { nudge (self); } - static void viewDidMoveToSuperview (id self, SEL) { nudge (self); } - static void viewDidMoveToWindow (id self, SEL) { nudge (self); } }; - static FlippedNSView& getViewClass() + static InnerNSView& getViewClass() { - static FlippedNSView result; + static InnerNSView result; return result; } };