diff options
author | Julien ROGER <gulien.roger@gmail.com> | 2016-02-10 23:52:03 +0100 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-02-13 12:30:31 +1000 |
commit | 1fbe4253aafc8821f5d9db0d7e99fcb1712c4cc5 (patch) | |
tree | 408a43f1770ae7f5bb2284cd7e01c1f7b39a46c7 /gtk2_ardour/time_axis_view.cc | |
parent | 108528b63df447fe64ff443ee988335d02e9a98a (diff) |
Fix 6609: Right-click in active track name box crashes
When right-clicking in the text entry, popup menu grabs focus. Consequently, the "focus out" handler is called, destroys the text entry and replaces it by the label name of the track.
When menu pops up, it tries to access to a widget no longer available.
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 4ad476b734..27db10c99b 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -104,6 +104,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie , _editor (ed) , name_entry (0) , ending_name_edit (false) + , by_popup_menu (false) , control_parent (0) , _order (0) , _effective_height (0) @@ -652,11 +653,21 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev) bool TimeAxisView::name_entry_focus_out (GdkEventFocus*) { + if (by_popup_menu) { + by_popup_menu = false; + return false; + } end_name_edit (RESPONSE_OK); return false; } void +TimeAxisView::name_entry_populate_popup (Gtk::Menu *) +{ + by_popup_menu = true; +} + +void TimeAxisView::begin_name_edit () { if (name_entry) { @@ -675,6 +686,7 @@ TimeAxisView::begin_name_edit () name_entry->signal_focus_out_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_out)); name_entry->set_text (name_label.get_text()); name_entry->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisView::end_name_edit), RESPONSE_OK)); + name_entry->signal_populate_popup().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_populate_popup)); if (name_label.is_ancestor (name_hbox)) { name_hbox.remove (name_label); |