From 9397158fbcb48dc4eef22c38ff8542492915a5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Mon, 9 May 2016 12:48:07 +0000 Subject: [PATCH] GtkFileChooser: don't override already opened folder When filechooer is re-used (instead of being created and destroyed every time it's needed), it might happen that the directory the application wishes to initially show is the same directory that was shown last time the filechooser was used. In that case, make sure filechooser knows that it does not need to do its default "select $pwd or $home" routine. https://bugzilla.gnome.org/show_bug.cgi?id=766122 --- gtk/gtkfilechooserwidget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 90e0addfc7..5da752a740 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -5666,6 +5666,9 @@ gtk_file_chooser_widget_select_file (GtkFileChooser *chooser, files.data = (gpointer) file; files.next = NULL; + /* Prevent the file chooser from loading a different folder when it is mapped */ + priv->reload_state = RELOAD_HAS_FOLDER; + result = show_and_select_files (impl, &files); g_object_unref (parent_file); return result;