From 2d631688f498d885f4f0567aaa4a419f2f9b3100 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 7 Jun 2022 17:47:07 +0200 Subject: [PATCH] Yet another attempt to debug/fix AU plugin window size on mac/M1 --- gtk2_ardour/au_pluginui.mm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index e06483099c..af724969af 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -235,10 +235,12 @@ static uint32_t block_plugin_redraws = 0; static const uint32_t minimum_redraw_rate = 30; /* frames per second */ static const uint32_t block_plugin_redraw_count = 15; /* number of combined plugin redraws to block, if blocking */ -#ifdef __ppc__ +#if (defined __ppc__ || MAC_OS_X_VERSION_MAX_ALLOWED >= 110000) /* PowerPC versions of OS X do not support libdispatch, which we use below when swizzling objective C. But they also don't have Retina * which is the underlying reason for this code. So just skip it on those CPUs. + * + * Also this is probably not relevant anymore on M1/BigSur, let's see */ @@ -688,6 +690,10 @@ AUPluginUI::create_cocoa_view () req_width = frame.size.width; req_height = frame.size.height; +#if 1 + std::cerr << "NSView initial size: " << req_width << " x " << req_height << "\n"; +#endif + resizable = [au_view autoresizingMask]; low_box.queue_resize (); @@ -901,6 +907,12 @@ AUPluginUI::cocoa_view_resized () req_width = new_frame.size.width; req_height = new_frame.size.height; +#if 1 + std::cerr << "NSView resized: " << req_width << " x " << req_height << "\n"; +#endif + + low_box.queue_resize (); + plugin_requested_resize = 0; }