From fce17338083a9c2c4e250bd8189c7f767148aca5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 17 Apr 2013 15:29:03 -0400 Subject: fix playhead dragging from rulers --- gtk2_ardour/editor_drag.cc | 18 ++++++++++++++++++ gtk2_ardour/editor_drag.h | 1 + gtk2_ardour/editor_rulers.cc | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 98d251f762..ea952e043e 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -178,6 +178,24 @@ DragManager::motion_handler (GdkEvent* e, bool from_autoscroll) return r; } +bool +DragManager::window_motion_handler (GdkEvent* e, bool from_autoscroll) +{ + bool r = false; + + _current_pointer_frame = _editor->window_event_frame (e, &_current_pointer_x, &_current_pointer_y); + + for (list::iterator i = _drags.begin(); i != _drags.end(); ++i) { + bool const t = (*i)->motion_handler (e, from_autoscroll); + if (t) { + r = true; + } + + } + + return r; +} + bool DragManager::have_item (ArdourCanvas::Item* i) const { diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 7c9b3538e9..4497cd025d 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -54,6 +54,7 @@ public: ~DragManager (); bool motion_handler (GdkEvent *, bool); + bool window_motion_handler (GdkEvent *, bool); void abort (); void add (Drag *); diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 477dd23f69..0566bca2da 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -314,7 +314,7 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev) } if (_drags->active ()) { - _drags->motion_handler (reinterpret_cast (ev), false); + _drags->window_motion_handler (reinterpret_cast (ev), false); } return true; -- cgit v1.2.3