From 446e6a8d6200b7f71bf3d8170448fa859771e25d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 5 Jan 2023 21:05:24 +0100 Subject: [PATCH] filedialog: Never set the chooser's file Instead, get by with setting the name and hope the filechooser figures things out by itself. Fixes #5496 --- gtk/gtkfiledialog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gtk/gtkfiledialog.c b/gtk/gtkfiledialog.c index 6f1a0dada2..6cf4f6bb0b 100644 --- a/gtk/gtkfiledialog.c +++ b/gtk/gtkfiledialog.c @@ -959,9 +959,7 @@ create_file_chooser (GtkFileDialog *self, file_chooser_set_shortcut_folders (GTK_FILE_CHOOSER (chooser), self->shortcut_folders); if (self->initial_folder) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), self->initial_folder, NULL); - if (self->initial_file) - gtk_file_chooser_set_file (GTK_FILE_CHOOSER (chooser), self->initial_file, NULL); - else if (self->initial_name) + if (self->initial_name && action == GTK_FILE_CHOOSER_ACTION_SAVE) gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (chooser), self->initial_name); return chooser;