diff options
author | Rui Matos <tiagomatos@gmail.com> | 2016-03-31 20:56:01 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2016-03-31 21:04:20 +0200 |
commit | b4143c6af95d7864b8bc9f120061e41d1987f00f (patch) | |
tree | 865e5e40d99ab07fd71ed4077b110509ffd4ce8d | |
parent | 3d76005585f10337c68a0d0659b8de2138d77860 (diff) | |
download | gtk+-b4143c6af95d7864b8bc9f120061e41d1987f00f.tar.gz |
gtkwindow: Don't allow unresizable windows to be smaller than required
Commit cdc580463e409a9b7e5f1480afa68d875ff3ff65 made it so that
unresizable windows can't be smaller than a set default size but it
lost the logic to ensure these windows remain at least big enough to
comply with their requisition.
https://bugzilla.gnome.org/show_bug.cgi?id=764174
-rw-r--r-- | gtk/gtkwindow.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index a7f86deaf0..5922415b59 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -10036,14 +10036,16 @@ gtk_window_update_fixed_size (GtkWindow *window, if (info->default_width > -1) { - new_geometry->min_width = MAX (default_width_csd, new_width); - new_geometry->max_width = new_geometry->min_width; + gint w = MAX (MAX (default_width_csd, new_width), new_geometry->min_width); + new_geometry->min_width = w; + new_geometry->max_width = w; } if (info->default_height > -1) { - new_geometry->min_height = MAX (default_height_csd, new_height); - new_geometry->max_height = new_geometry->min_height; + gint h = MAX (MAX (default_height_csd, new_height), new_geometry->min_height); + new_geometry->min_height = h; + new_geometry->max_height = h; } } } |