From ceb21790b488a40f0ef6188348a205e8d09f3c57 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 15 Oct 2023 12:50:34 +0100 Subject: [PATCH] Bug 799090 - Right Clicking scheduled transaction If you have a highlighted SX and you right click on another SX the new, edit, delete popup uses the highlighted SX not the one you clicked on. This is misleading because the box appears at the right clicked location, and it looks like that is the SX it will affect. To fix this, check to see if SX right clicked on is selected, if not unselect all SX's and select the one clicked on before popup. --- gnucash/gnome/gnc-plugin-page-sx-list.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c index 61b32be911..8ffcc93a28 100644 --- a/gnucash/gnome/gnc-plugin-page-sx-list.c +++ b/gnucash/gnome/gnc-plugin-page-sx-list.c @@ -425,6 +425,20 @@ treeview_button_press (GtkTreeView *treeview, GdkEvent *event, GdkEventButton *event_button = (GdkEventButton*)event; if (event_button->button == GDK_BUTTON_SECONDARY) { + GtkTreePath *path = NULL; + if (gtk_tree_view_get_path_at_pos (priv->tree_view, event_button->x, event_button->y, + &path, NULL, NULL, NULL)) + { + GtkTreeSelection *selection = gtk_tree_view_get_selection (priv->tree_view); + + if (!gtk_tree_selection_path_is_selected (selection, path)) + { + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_path (selection, path); + } + } + gtk_tree_path_free (path); + treeview_popup (tree_view, event, page); return TRUE; }