summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdialog.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-12-05 11:44:51 +0100
committerJonas Ådahl <jadahl@gmail.com>2020-12-07 20:37:29 +0100
commit27077d5be8b1040a1ff1a0bb94d60249514a436b (patch)
tree19b3b62f41ee0fca75f8af10c3fea7fc84bbcc6c /gtk/gtkfilechooserdialog.c
parentfd01723470aa694f5f0b25929d2434846bbb1535 (diff)
downloadgtk+-27077d5be8b1040a1ff1a0bb94d60249514a436b.tar.gz
gtk/window: Make 'default-size' adapt to configured size
This commit changes the behavior of window size computation and the default size properties to: * The default-width and default-height properties are updated to the current window size unless the size is fixed by e.g. being maxmized, tiled etc. * The compute-size semantics are to just pick the default size, or if not adequate, use the measured size, and consequently update the default size, unless unresizable. * gtk_window_get_size() is removed, what's more likely relevant is the gtk_window_get_default_size() which will now contain more sensible values. Various places that used gtk_window_get_size() were updated to use gtk_window_get_default_size() to remember and restore previous sizes. This also changes the default value of 'default-width' and 'default-height' from -1 to 0. The gtk builder simplify tool is taught how to omit when the default size is set to both -1 and 0.
Diffstat (limited to 'gtk/gtkfilechooserdialog.c')
-rw-r--r--gtk/gtkfilechooserdialog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 6cff44ec93..b571a46f1e 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -628,7 +628,7 @@ save_dialog_geometry (GtkFileChooserDialog *dialog)
window = GTK_WINDOW (dialog);
- gtk_window_get_size (window, &width, &height);
+ gtk_window_get_default_size (window, &width, &height);
g_settings_get (settings, SETTINGS_KEY_WINDOW_SIZE, "(ii)", &old_width, &old_height);
if (old_width != width || old_height != height)