static gboolean on_stash_view_button_press_event (GtkWidget *stash_view, GdkEventButton *event, GitStashPane *self) { gboolean path_valid; GtkTreePath *path; gboolean ret = FALSE; path_valid = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (stash_view), event->x, event->y, &path, NULL, NULL, NULL); if (event->type == GDK_BUTTON_PRESS && event->button == 3) { if (path_valid && gtk_tree_path_get_depth (path) == 1) { git_pane_popup_menu (GIT_PANE (self), "GitStashPopup", event->button, event->time); } } /* Don't forward button presses to diff renderers */ if (path_valid) { ret = gtk_tree_path_get_depth (path) == 2; gtk_tree_path_free (path); } return ret; }
static gboolean on_stash_view_button_press_event (GtkWidget *stash_view, GdkEventButton *event, GitStashPane *self) { GtkTreeSelection *selection; if (event->type == GDK_BUTTON_PRESS && event->button == 3) { selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (stash_view)); if (gtk_tree_selection_count_selected_rows (selection) > 0) { git_pane_popup_menu (GIT_PANE (self), "GitStashPopup", event->button, event->time); } } return FALSE; }