Browse Source

Bugfix: EmbedExternalExampleUI resizing on Mac (#319)

* Bugfix: EmbedExternalExampleUI resizing on Mac

* Make 6618e99 follow existing ObjC code style

Also allow uiIdle() to run for X11
pull/320/head
lucianoiam GitHub 3 years ago
parent
commit
25d7902818
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      examples/EmbedExternalUI/EmbedExternalExampleUI.cpp

+ 10
- 4
examples/EmbedExternalUI/EmbedExternalExampleUI.cpp View File

@@ -96,11 +96,10 @@ public:
fView = [NSView new];
DISTRHO_SAFE_ASSERT_RETURN(fView != nullptr,);

[fView initWithFrame:NSMakeRect(0, 0, getWidth(), getHeight())];
[fView setAutoresizesSubviews:YES];
[fView setFrame:NSMakeRect(0, 0, getWidth(), getHeight())];
[fView setHidden:NO];
[fView setNeedsDisplay:YES];
[fView setAutoresizesSubviews:YES];
[fView setWantsLayer:YES];
[[fView layer] setBackgroundColor:[[NSColor blueColor] CGColor]];

if (isEmbed())
{
@@ -271,6 +270,9 @@ protected:
UI::sizeChanged(width, height);

#if defined(DISTRHO_OS_MAC)
NSRect rect = [fView frame];
rect.size = CGSizeMake((CGFloat)width, (CGFloat)height);
[fView setFrame:rect];
#elif defined(DISTRHO_OS_WINDOWS)
#else
if (fWindow != 0)
@@ -343,6 +345,10 @@ protected:
{
// d_stdout("uiIdle");
#if defined(DISTRHO_OS_MAC)
if (isEmbed()) {
return;
}

NSAutoreleasePool* const pool = [[NSAutoreleasePool alloc] init];
NSDate* const date = [NSDate distantPast];



Loading…
Cancel
Save