From 5d1b75bd4faa96badd94863525b10777c9664d97 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Mar 2020 15:30:52 -0600 Subject: likely fix for cases where a button release event falls through from the canvas to the editor, during a drag The drag code expects coordinates in canvas coordinates, but we were not translating them at the editor level (canvas event handling does do this, but cannot affect the situation if the event falls through to the editor) --- gtk2_ardour/editor_canvas_events.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index f098e40df6..884e7ca82e 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -188,7 +188,15 @@ Editor::track_canvas_button_release_event (GdkEventButton *event) { if (!Keyboard::is_context_menu_event (event)) { if (_drags->active ()) { - _drags->end_grab ((GdkEvent*) event); + + GdkEvent copy = *((GdkEvent*) event); + Duple winpos = Duple (event->x, event->y); + Duple where = _track_canvas->window_to_canvas (winpos); + + copy.button.x = where.x; + copy.button.y = where.y; + + _drags->end_grab (©); } } return false; -- cgit v1.2.3