From c6ef4c3545ebf829a5fdb0129c8431620bc0f112 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 28 Sep 2024 21:40:11 +0200 Subject: [PATCH] Fix interaction with snapshot list * Select snapshot before showing relevant context menu * Ignore clicks on empty space (no path) --- gtk2_ardour/editor_snapshots.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk2_ardour/editor_snapshots.cc b/gtk2_ardour/editor_snapshots.cc index fc6faf847a..9661916fa5 100644 --- a/gtk2_ardour/editor_snapshots.cc +++ b/gtk2_ardour/editor_snapshots.cc @@ -84,6 +84,10 @@ EditorSnapshots::button_press (GdkEventButton* ev) int cx; int cy; _snapshot_display.get_path_at_pos ((int) ev->x, (int) ev->y, path, col, cx, cy); + if (!path) { + return false; + } + _snapshot_display.get_selection()->select (path); Gtk::TreeModel::iterator iter = _snapshot_model->get_iter (path); if (iter) { Gtk::TreeModel::Row row = *iter; @@ -97,6 +101,9 @@ EditorSnapshots::button_press (GdkEventButton* ev) int cy; string snap_name; _snapshot_display.get_path_at_pos ((int) ev->x, (int) ev->y, path, col, cx, cy); + if (!path) { + return false; + } Gtk::TreeModel::iterator iter = _snapshot_model->get_iter (path); if (iter) { Gtk::TreeModel::Row row = *iter;