add a check on the event type passed to start Drags

Drags should always be started by a button press event.
This commit is contained in:
Paul Davis 2024-12-27 14:09:11 -07:00
parent 25b830b032
commit 76fa75cf9a

View file

@ -346,6 +346,11 @@ Drag::set_grab_button_anyway (GdkEvent* ev)
void void
Drag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) Drag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
{ {
if (event->type != GDK_BUTTON_PRESS) {
fatal << "Drag started with non-button-press event (" << event_type_string (event->type) << ')' << endmsg;
/*NOTREACHED*/
}
/* we set up x/y dragging constraints on first move */ /* we set up x/y dragging constraints on first move */
_constraint_pressed = ArdourKeyboard::indicates_constraint (event->button.state); _constraint_pressed = ArdourKeyboard::indicates_constraint (event->button.state);