summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-10-21 13:53:49 -0700
committerCorey Berla <corey@berla.me>2022-10-21 13:57:15 -0700
commit22aca8952fbbc13490fd9ab0263894bbbfd897e5 (patch)
treec6cd4df07885ad175ecc9d19e900c1d698b0bea0
parentc0e437d163f473a379cccd6789702243f47e9834 (diff)
downloadgtk+-22aca8952fbbc13490fd9ab0263894bbbfd897e5.tar.gz
filechoosercell: Select item when right click or long press
-rw-r--r--gtk/gtkfilechoosercell.c4
1 files changed, 4 insertions, 0 deletions
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);