Skip to content

Commit

Permalink
VST(3) Host: Use standard (non-flipped) coordinate space for plugin e…
Browse files Browse the repository at this point in the history
…ditors

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.
  • Loading branch information
reuk committed Jun 13, 2022
1 parent 0a6000d commit a868952
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions modules/juce_audio_processors/juce_audio_processors.cpp
Expand Up @@ -142,21 +142,19 @@ struct NSViewComponentWithParent : public NSViewComponent,
}
}

struct FlippedNSView : public ObjCClass<NSView>
struct InnerNSView : public ObjCClass<NSView>
{
FlippedNSView()
: ObjCClass ("JuceFlippedNSView_")
InnerNSView()
: ObjCClass ("JuceInnerNSView_")
{
addIvar<NSViewComponentWithParent*> ("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)
Expand All @@ -166,15 +164,12 @@ struct NSViewComponentWithParent : public NSViewComponent,
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;
}
};
Expand Down

0 comments on commit a868952

Please sign in to comment.