View Issue Details

IDProjectCategoryView StatusLast Update
0004733ardourbugspublic2020-04-19 20:16
Reporternick Assigned Tocth103  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0-beta3 
Target Version3.0 
Summary0004733: [PATCH] When Showing LV2 UIs top-toolbar butons are repacked
DescriptionIn the lv2 ui code an hbox is created to hold the preset combo, add/focus and a few other buttons. This box is packed into the ui. This happens ever time the lv2 plugin ui is instantiated, which means, after the first time, an attempt is made to repack those buttons into a newly created hbox when they are still in the old one. In addition, the newly created hbox (empty as nothing is successfully packed in it) is still packed into the window, meaning the plugin's ui is pushed further and further down each time the window is opened.

Additional InformationThe attached patch fixes this problem with a flag to indicate if the hbox has already been packed into the window and not attempting to redo it if so.

The other solution is to unpack the buttons, and remove the hbox when the ui is hidden, but that seems uglier.
TagsNo tags attached.

Activities

2012-02-18 16:32

 

ardour.hbox.patch (1,915 bytes)   
Index: gtk2_ardour/lv2_plugin_ui.cc
===================================================================
--- gtk2_ardour/lv2_plugin_ui.cc	(revision 11501)
+++ gtk2_ardour/lv2_plugin_ui.cc	(working copy)
@@ -134,6 +134,7 @@
 	, _gui_widget(NULL)
 	, _values(NULL)
 	, _external_ui_ptr(NULL)
+	, _packed_once(false)
 	, _inst(NULL)
 {
 }
@@ -209,17 +210,20 @@
 	_external_ui_ptr = NULL;
 	if (_inst) {
 		if (!is_external_ui) {
-			Gtk::HBox* box = manage (new Gtk::HBox);
-			box->set_spacing (6);
-			box->set_border_width (6);
-			box->pack_end (focus_button, false, false);
-			box->pack_end (bypass_button, false, false, 10);
-			box->pack_end (delete_button, false, false);
-			box->pack_end (save_button, false, false);
-			box->pack_end (add_button, false, false);
-			box->pack_end (_preset_combo, false, false);
-			box->show_all();
-			pack_start(*box, false, false);
+  		        if (!_packed_once) {
+			        Gtk::HBox* box = manage (new Gtk::HBox);
+				box->set_spacing (6);
+				box->set_border_width (6);
+				box->pack_end (focus_button, false, false);
+				box->pack_end (bypass_button, false, false, 10);
+				box->pack_end (delete_button, false, false);
+				box->pack_end (save_button, false, false);
+				box->pack_end (add_button, false, false);
+				box->pack_end (_preset_combo, false, false);
+				box->show_all();
+				pack_start(*box, false, false);
+				_packed_once = true;
+			}
 
 			GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst);
 			_gui_widget = Glib::wrap(c_widget);
Index: gtk2_ardour/lv2_plugin_ui.h
===================================================================
--- gtk2_ardour/lv2_plugin_ui.h	(revision 11501)
+++ gtk2_ardour/lv2_plugin_ui.h	(working copy)
@@ -74,6 +74,8 @@
 	LV2_Feature _external_ui_feature;
 	struct lv2_external_ui* _external_ui_ptr;
 	Gtk::Window* _win_ptr;
+	
+	bool _packed_once;
 
 	static void on_external_ui_closed(void* controller);
 
ardour.hbox.patch (1,915 bytes)   

cth103

2012-03-04 21:46

administrator   ~0012850

Fixed in SVN 11589, a slightly different way. Thanks!

system

2020-04-19 20:16

developer   ~0022972

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2012-02-18 16:32 nick New Issue
2012-02-18 16:32 nick File Added: ardour.hbox.patch
2012-02-23 16:46 cth103 cost => 0.00
2012-02-23 16:46 cth103 Target Version => 3.0 beta4
2012-02-23 16:46 cth103 Summary When Showing LV2 UIs top-toolbar butons are repacked => [PATCH] When Showing LV2 UIs top-toolbar butons are repacked
2012-03-04 21:46 cth103 Note Added: 0012850
2012-03-04 21:46 cth103 Status new => resolved
2012-03-04 21:46 cth103 Resolution open => fixed
2012-03-04 21:46 cth103 Assigned To => cth103
2012-05-23 15:09 cth103 Target Version 3.0 beta4 => 3.0
2020-04-19 20:16 system Note Added: 0022972
2020-04-19 20:16 system Status resolved => closed