From: Corey Berla Date: Fri, 21 Oct 2022 20:53:49 +0000 (-0700) Subject: filechoosercell: Select item when right click or long press X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~142^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=22aca8952fbbc13490fd9ab0263894bbbfd897e5;p=gtk4.git filechoosercell: Select item when right click or long press --- diff --git a/gtk/gtkfilechoosercell.c b/gtk/gtkfilechoosercell.c index 267b9511e3..c14ae0a021 100644 --- a/gtk/gtkfilechoosercell.c +++ b/gtk/gtkfilechoosercell.c @@ -67,11 +67,15 @@ popup_menu (GtkFileChooserCell *self, double y) { GtkWidget *widget = GTK_WIDGET (self); + GtkSelectionModel *model; GtkWidget *impl; double xx, yy; impl = gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_CHOOSER_WIDGET); + model = gtk_file_chooser_widget_get_selection_model (GTK_FILE_CHOOSER_WIDGET (impl)); + gtk_selection_model_select_item (model, self->position, TRUE); + gtk_widget_translate_coordinates (widget, GTK_WIDGET (impl), x, y, &xx, &yy);