From 2c85be990dfde874ea16fd5a875e8ecfdfbc2400 Mon Sep 17 00:00:00 2001 From: Eivind Naess Date: Sun, 8 Mar 2020 18:54:10 -0700 Subject: [PATCH] Fix for issue #2497, see https://gitlab.gnome.org/GNOME/gtk/issues/2497 The 'selection-changed' signal is emitted unconditionally, even in the case when there is no selection to be cleared. As a result, the subscriber receives the initial signal and if he calls gtk_file_chooser_get_uri(), no value is currently selected. --- gtk/gtkfilechooserbutton.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 6de8a4ee6d..fa9b945b7f 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -610,10 +610,9 @@ unselect_current_file (GtkFileChooserButton *button) { g_object_unref (priv->selection_while_inactive); priv->selection_while_inactive = NULL; + priv->is_changing_selection = TRUE; } - priv->is_changing_selection = TRUE; - update_label_and_image (button); update_combo_box (button); }