From faa1d4f925da74f851df5a8396725c8fe428f77f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 26 Jun 2021 14:31:10 +0100 Subject: [PATCH] Fix initial size for LV2 macOS UIs with no UI resize extension --- source/utils/CarlaPluginUI.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 3dee42a6f..ee3f6beb4 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -622,7 +622,7 @@ public: if (fParentWindow != nullptr) { [fParentWindow addChildWindow:fWindow - ordered:NSWindowAbove]; + ordered:NSWindowAbove]; } else { @@ -720,10 +720,17 @@ public: 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