Fix crash when clicking on an AutomationRegionView in range mode.
authorCarl Hetherington <carl@carlh.net>
Thu, 9 Sep 2010 21:35:13 +0000 (21:35 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 9 Sep 2010 21:35:13 +0000 (21:35 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7764 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/automation_region_view.cc

index 4b98a485de270d26cc4216e5b50bf404e45938b6..ca1e787f3a3fb2332244baca48f50c6303ce9023 100644 (file)
@@ -31,6 +31,7 @@
 #include "midi_automation_line.h"
 #include "editor_drag.h"
 #include "editor.h"
+#include "editing.h"
 
 #include "i18n.h"
 
@@ -92,10 +93,12 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
 bool
 AutomationRegionView::canvas_event(GdkEvent* ev)
 {
-       if (ev->type == GDK_BUTTON_PRESS) {
+       PublicEditor& e = trackview.editor ();
+
+       if (ev->type == GDK_BUTTON_PRESS && e.current_mouse_mode() == Editing::MouseObject) {
 
                /* XXX: icky dcast to Editor */
-               trackview.editor().drags()->set (new RubberbandSelectDrag (dynamic_cast<Editor*> (&trackview.editor()), group), ev);
+               e.drags()->set (new RubberbandSelectDrag (dynamic_cast<Editor*> (&e), group), ev);
                
        } else if (ev->type == GDK_BUTTON_RELEASE) {