<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,6 +36,12 @@
 	position doesn't quite work yet, but we'll leave it in as a
 	reference.
 
+	* gtk/gtkfilechooserdefault.c (save_dialog_geometry): New function.
+	(settings_save): Save the dialog's geometry.
+	(gtk_file_chooser_default_get_default_size): Load the geometry
+	from the settings.  If it was already saved, return that instead
+	of computing an ad-hoc size.
+
 2009-01-13  Matthias Clasen  &lt;mclasen@redhat.com&gt;
 
 	Bug 450716 &#8211; New API to change global IM</diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,7 @@
 #include &quot;gtkexpander.h&quot;
 #include &quot;gtkfilechooserprivate.h&quot;
 #include &quot;gtkfilechooserdefault.h&quot;
+#include &quot;gtkfilechooserdialog.h&quot;
 #include &quot;gtkfilechooserembed.h&quot;
 #include &quot;gtkfilechooserentry.h&quot;
 #include &quot;gtkfilechoosersettings.h&quot;
@@ -6025,6 +6026,31 @@ settings_load (GtkFileChooserDefault *impl)
 }
 
 static void
+save_dialog_geometry (GtkFileChooserDefault *impl, GtkFileChooserSettings *settings)
+{
+  GtkWindow *toplevel;
+  int x, y, width, height;
+
+  /* We don't save the geometry in non-expanded &quot;save&quot; mode, so that the &quot;little
+   * dialog&quot; won't make future Open dialogs too small.
+   */
+  if (!(impl-&gt;action == GTK_FILE_CHOOSER_ACTION_OPEN
+	|| impl-&gt;action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
+	|| impl-&gt;expand_folders))
+    return;
+
+  toplevel = get_toplevel (GTK_WIDGET (impl));
+
+  if (!(toplevel &amp;&amp; GTK_IS_FILE_CHOOSER_DIALOG (toplevel)))
+    return;
+
+  gtk_window_get_position (toplevel, &amp;x, &amp;y);
+  gtk_window_get_size (toplevel, &amp;width, &amp;height);
+
+  _gtk_file_chooser_settings_set_geometry (settings, x, y, width, height);
+}
+
+static void
 settings_save (GtkFileChooserDefault *impl)
 {
   GtkFileChooserSettings *settings;
@@ -6036,6 +6062,8 @@ settings_save (GtkFileChooserDefault *impl)
   _gtk_file_chooser_settings_set_expand_folders (settings, impl-&gt;expand_folders);
   _gtk_file_chooser_settings_set_show_size_column (settings, impl-&gt;show_size_column);
 
+  save_dialog_geometry (impl, settings);
+
   /* NULL GError */
   _gtk_file_chooser_settings_save (settings, NULL);
 
@@ -7938,6 +7966,20 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
       || impl-&gt;action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
       || impl-&gt;expand_folders)
     {
+      GtkFileChooserSettings *settings;
+      int x, y, width, height;
+
+      settings = _gtk_file_chooser_settings_new ();
+      _gtk_file_chooser_settings_get_geometry (settings, &amp;x, &amp;y, &amp;width, &amp;height);
+      g_object_unref (settings);
+
+      if (x &gt;= 0 &amp;&amp; y &gt;= 0 &amp;&amp; width &gt; 0 &amp;&amp; height &gt; 0)
+	{
+	  *default_width = width;
+	  *default_height = height;
+	  return;
+	}
+
       find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
 
       if (impl-&gt;preview_widget_active &amp;&amp;</diff>
      <filename>gtk/gtkfilechooserdefault.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6ebf62c6325908a1732e88188e3e623dbba68f6f</id>
    </parent>
  </parents>
  <author>
    <name>federico</name>
    <email>federico@7eb1c76a-c725-0410-a3b5-a37faf6256f8</email>
  </author>
  <url>http://github.com/garnacho/gtk-mpx/commit/148caad0aa169a9e9ae6c0a45739c12eef89930a</url>
  <id>148caad0aa169a9e9ae6c0a45739c12eef89930a</id>
  <committed-date>2009-01-14T12:19:10-08:00</committed-date>
  <authored-date>2009-01-14T12:19:10-08:00</authored-date>
  <message>Load/save the file chooser's size
	* gtk/gtkfilechooserdefault.c (save_dialog_geometry): New function.
	(settings_save): Save the dialog's geometry.
	(gtk_file_chooser_default_get_default_size): Load the geometry
	from the settings.  If it was already saved, return that instead
	of computing an ad-hoc size.

Signed-off-by: Federico Mena Quintero &lt;federico@novell.com&gt;

git-svn-id: svn+ssh://svn.gnome.org/svn/gtk+/trunk@22119 7eb1c76a-c725-0410-a3b5-a37faf6256f8</message>
  <tree>5c8317073cefbcf60f25237a827e926c49522782</tree>
  <committer>
    <name>federico</name>
    <email>federico@7eb1c76a-c725-0410-a3b5-a37faf6256f8</email>
  </committer>
</commit>
