From 0992272858858e9991fc433e6eefa56a2ee968d4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 28 Oct 2015 14:09:13 +0100 Subject: [PATCH] fix embedding AU/carbon UIs the UI shows top/left (not centered, no resize) more detail work to come. --- gtk2_ardour/au_pluginui.mm | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index a964017499..af174f9963 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -240,11 +240,13 @@ AUPluginUI::AUPluginUI (boost::shared_ptr insert) low_box.signal_realize().connect (mem_fun (this, &AUPluginUI::lower_box_realized)); low_box.signal_visibility_notify_event ().connect (mem_fun (this, &AUPluginUI::lower_box_visibility_notify)); - low_box.signal_size_request ().connect (mem_fun (this, &AUPluginUI::lower_box_size_request)); - low_box.signal_size_allocate ().connect (mem_fun (this, &AUPluginUI::lower_box_size_allocate)); - low_box.signal_map ().connect (mem_fun (this, &AUPluginUI::lower_box_map)); - low_box.signal_unmap ().connect (mem_fun (this, &AUPluginUI::lower_box_unmap)); - low_box.signal_expose_event ().connect (mem_fun (this, &AUPluginUI::lower_box_expose)); + if (au_view) { + low_box.signal_size_request ().connect (mem_fun (this, &AUPluginUI::lower_box_size_request)); + low_box.signal_size_allocate ().connect (mem_fun (this, &AUPluginUI::lower_box_size_allocate)); + low_box.signal_map ().connect (mem_fun (this, &AUPluginUI::lower_box_map)); + low_box.signal_unmap ().connect (mem_fun (this, &AUPluginUI::lower_box_unmap)); + low_box.signal_expose_event ().connect (mem_fun (this, &AUPluginUI::lower_box_expose)); + } } AUPluginUI::~AUPluginUI () @@ -539,8 +541,8 @@ AUPluginUI::create_carbon_view () req_width = (int) (size.x + 0.5); req_height = (int) (size.y + 0.5); - SizeWindow (carbon_window, prefwidth, req_height, true); - low_box.set_size_request (prefwidth, req_height); // ?? + SizeWindow (carbon_window, req_width, req_height, true); + low_box.set_size_request (req_width, req_height); return 0; #else @@ -596,13 +598,6 @@ AUPluginUI::parent_carbon_window () return -1; } - Gtk::Container* toplevel = get_toplevel(); - - if (!toplevel || !toplevel->is_toplevel()) { - error << _("AUPluginUI: no top level window!") << endmsg; - return -1; - } - /* figure out where the cocoa parent window is in carbon-coordinate space, which differs from both cocoa-coordinate space and GTK-coordinate space */