diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-25 15:30:52 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-25 15:30:52 -0600 |
commit | 5d1b75bd4faa96badd94863525b10777c9664d97 (patch) | |
tree | 2cd8ffb98df3d9ad74cf4ee8a1ef3692d1899715 | |
parent | 4151ec19074913376b3a6a19a0812f9fdebe7eca (diff) |
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)
-rw-r--r-- | gtk2_ardour/editor_canvas_events.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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; |