summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2005-02-02 18:25:27 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2005-02-02 18:25:27 +0000
commit1707e510a8b01baf0c4f9f6d16134f339c9ab5df (patch)
tree13fbdc5abafe31fde292af56b810e4cad052a09d /gtk/gtkfilechooserdefault.c
parent8c323acbae55ce24674af03d59610113837a7801 (diff)
downloadgtk+-1707e510a8b01baf0c4f9f6d16134f339c9ab5df.tar.gz
Merged from gtk-2-6:
2005-02-02 Federico Mena Quintero <federico@ximian.com> Merged from gtk-2-6: * gtk/gtkfilechooserdefault.c (pending_select_paths_process): Don't select the first row if the chooser is not mapped. This happens when it's acting on behalf of GtkFileChooserButton. Also, don't select the first row if we are in SAVE or CREATE_FOLDER modes --- I had missed that (see the ChangeLog entry from 2005-01-18). Fixes #165264.
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index c2e0f8e603..22738430bd 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4592,7 +4592,21 @@ pending_select_paths_process (GtkFileChooserDefault *impl)
browse_files_center_selected_row (impl);
}
else
- browse_files_select_first_row (impl);
+ {
+ /* We only select the first row if the chooser is actually mapped ---
+ * selecting the first row is to help the user when he is interacting with
+ * the chooser, but sometimes a chooser works not on behalf of the user,
+ * but rather on behalf of something else like GtkFileChooserButton. In
+ * that case, the chooser's selection should be what the caller expects,
+ * as the user can't see that something else got selected. See bug #165264.
+ *
+ * Also, we don't select the first file if we are in SAVE or CREATE_FOLDER
+ * modes. Doing so would change the contents of the filename entry.
+ */
+ if (GTK_WIDGET_MAPPED (impl)
+ && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
+ browse_files_select_first_row (impl);
+ }
g_assert (impl->pending_select_paths == NULL);
}