From a1d5d6f4440dda98e8fab29b9079d5997162637c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 Jan 2013 01:37:44 +0000 Subject: [PATCH] make height of name_label and name_entry the same to avoid button wierdness while track name editing; fix crash caused by nested calls to end_name_edit() git-svn-id: svn://localhost/ardour2/branches/3.0@13936 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/time_axis_view.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 7461035a78..7bbf5caa60 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -112,7 +112,13 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie name_label.set_name ("TrackLabel"); name_label.set_alignment (0.0, 0.5); ARDOUR_UI::instance()->set_tip (name_label, _("Track/Bus name (double click to edit)")); - + + Gtk::Entry* an_entry = new Gtk::Entry; + Gtk::Requisition req; + an_entry->size_request (req); + name_label.set_size_request (-1, req.height); + delete an_entry; + name_hbox.pack_start (name_label, true, true); name_hbox.show (); name_label.show (); @@ -641,9 +647,16 @@ TimeAxisView::end_name_edit (int response) edit_next = true; } - /* this will delete the name_entry */ - name_hbox.remove (*name_entry); + /* this will delete the name_entry. but it will also drop focus, which + * will cause another callback to this function, so set name_entry = 0 + * first to ensure we don't double-remove etc. etc. + */ + + Gtk::Entry* tmp = name_entry; name_entry = 0; + name_hbox.remove (*tmp); + + /* put the name label back */ name_hbox.pack_start (name_label); name_label.show ();