gtkwindow: Don't allow unresizable windows to be smaller than required
authorRui Matos <tiagomatos@gmail.com>
Thu, 31 Mar 2016 18:56:01 +0000 (20:56 +0200)
committerRui Matos <tiagomatos@gmail.com>
Fri, 1 Apr 2016 13:30:03 +0000 (15:30 +0200)
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

gtk/gtkwindow.c

index 31086eddf5a73d471ac51c7ec0bd832bd2a94358..f1d736c88576b72ad1d23f4cfde89ca47151c8eb 100644 (file)
@@ -9983,14 +9983,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;
         }
     }
 }