diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 055129b704..7b5820cd27 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -209,6 +209,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr pi, bool scrol scroller.set_name ("PluginEditor"); } else { scroller.signal_size_request().connect (sigc::mem_fun(*this, &GenericPluginUI::scroller_size_request)); + scroller.signal_realize().connect (sigc::mem_fun(scroller, &Widget::queue_resize)); scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER); } @@ -228,15 +229,15 @@ GenericPluginUI::scroller_size_request (Gtk::Requisition* a) { GtkRequisition request = hpacker.size_request(); - Glib::RefPtr window (get_window()); + Glib::RefPtr window (scroller.get_window()); Glib::RefPtr screen; if (window) { - screen = get_screen(); + screen = window->get_screen(); } if (!screen) { - a->width = request.width; + a->width = min(1024, request.width); return; }