diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index e9269841ff..13902a111f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1085,6 +1085,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType); bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType); bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); + bool button_double_click_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); bool button_press_dispatch (GdkEventButton*); bool button_release_dispatch (GdkEventButton*); bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index be716d64d0..c91e9d1b34 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1269,6 +1269,10 @@ bool Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) { if (event->type != GDK_BUTTON_PRESS) { + if (event->type == GDK_2BUTTON_PRESS) { + gdk_pointer_ungrab (GDK_CURRENT_TIME); + return button_double_click_handler (item, event, item_type); + } return false; } @@ -1392,6 +1396,37 @@ Editor::button_release_dispatch (GdkEventButton* ev) return button_bindings->activate (b, Gtkmm2ext::Bindings::Release); } +bool +Editor::button_double_click_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) { + + if (event->button.button != 1) { + return false; + } + + switch (item_type) { + case RegionItem: + case NoteItem: + case PlayheadCursorItem: + case MarkerItem: + case RangeMarkerBarItem: + case CdMarkerBarItem: + case TempoMarkerItem: + case MeterMarkerItem: + case MarkerBarItem: + case TempoBarItem: + case MeterBarItem: + case TransportMarkerBarItem: + case StreamItem: + break; + + default: + break; + } + return false; +} + + + bool Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) {