Fix Mac Plugin re/sizing

Some plugin UIs, particularly those that cannot be resized
unset `autoresizesSubviews`. Since the plugin-view is re-parented,
the host has to directly set the view's size.

However some plugins have multiple child views, apparently
for off-screen pixmaps (e.g. UAD plugins). Those additional
should not be resized (or re-stacked).

e.g.

Reason-Rack
  view 0x7fe27e44e570 @ 0, 33 834 x 804
    view 0x7fe288aa3770 @ 278, 268 278 x 268

UAD Tube-tech
  view 0x7fe270a9cbf0 @ 0, 33 1160 x 374
    view 0x7fe28883d030 @ 0, 0 1160 x 374
    view 0x7fe2888546e0 @ 0, 0 1160 x 24


see also aef366c156
https://discourse.ardour.org/t/uad-plugin-will-not-load-shows-as-expired-when-its-not/105756/5?u=x42
This commit is contained in:
Robin Gareus 2021-04-27 23:50:59 +02:00
parent d627e00ff6
commit b6c75ef42a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 4 additions and 0 deletions

View File

@ -867,6 +867,7 @@ AUPluginUI::cocoa_view_resized ()
for (unsigned long i = 0; i < [subviews count]; ++i) {
NSView* subview = [subviews objectAtIndex:i];
[subview setFrame:NSMakeRect (0, 0, new_frame.size.width, new_frame.size.height)];
break; /* only resize first subview */
}
/* also be sure to redraw the topbox because this can
@ -1092,6 +1093,7 @@ AUPluginUI::parent_cocoa_window ()
for (unsigned long i = 0; i < [subviews count]; ++i) {
NSView* subview = [subviews objectAtIndex:i];
[subview setFrame:NSMakeRect (0, 0, req_width, req_height)];
break; /* only resize first subview */
}
last_au_frame = [au_view frame];

View File

@ -222,6 +222,7 @@ MacVSTPluginUI::lower_box_size_allocate (Gtk::Allocation& allocation)
for (unsigned long i = 0; i < [subviews count]; ++i) {
NSView* subview = [subviews objectAtIndex:i];
[subview setFrame:NSMakeRect (0, 0, allocation.get_width (), allocation.get_height ())];
break; /* only resize first subview */
}
}

View File

@ -153,6 +153,7 @@ VST3NSViewPluginUI::view_size_allocate (Gtk::Allocation& allocation)
for (unsigned long i = 0; i < [subviews count]; ++i) {
NSView* subview = [subviews objectAtIndex:i];
[subview setFrame:NSMakeRect (0, 0, allocation.get_width (), allocation.get_height ())];
break; /* only resize first subview */
}
}