Browse Source

Fix initial size for LV2 macOS UIs with no UI resize extension

tags/v2.3.1
falkTX 3 years ago
parent
commit
faa1d4f925
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      source/utils/CarlaPluginUI.cpp

+ 11
- 4
source/utils/CarlaPluginUI.cpp View File

@@ -622,7 +622,7 @@ public:
if (fParentWindow != nullptr) if (fParentWindow != nullptr)
{ {
[fParentWindow addChildWindow:fWindow [fParentWindow addChildWindow:fWindow
ordered:NSWindowAbove];
ordered:NSWindowAbove];
} }
else else
{ {
@@ -720,10 +720,17 @@ public:
ordered:NSWindowAbove]; ordered:NSWindowAbove];
} }


void setChildWindow(void* const window) override
void setChildWindow(void* const childWindow) override
{ {
carla_debug("CocoaPluginUI::setChildWindow(%p)", window);
CARLA_SAFE_ASSERT_RETURN(window != nullptr,);
carla_debug("CocoaPluginUI::setChildWindow(%p)", childWindow);
CARLA_SAFE_ASSERT_RETURN(childWindow != nullptr,);

NSView* const view = (NSView*)childWindow;
const NSRect frame = [view frame];

[fWindow setContentSize:frame.size];
[fView setFrame:frame];
[fView setNeedsDisplay:YES];
} }


void* getPtr() const noexcept override void* getPtr() const noexcept override


Loading…
Cancel
Save