[gtk: 46/88] gtk/window: Use default size if non-resizable if set
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 46/88] gtk/window: Use default size if non-resizable if set
- Date: Tue, 8 Dec 2020 15:38:41 +0000 (UTC)
commit 5eca548accbeaa93567dc721dcbc8228ae74ab02
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 2 16:44:25 2020 +0100
gtk/window: Use default size if non-resizable if set
gtk/gtkwindow.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b3f848f8e1..42f35da098 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4277,12 +4277,22 @@ toplevel_compute_size (GdkToplevel *toplevel,
}
else if (!priv->resizable)
{
- width = nat_width;
- height = nat_height;
-
- gtk_window_update_csd_size (window,
- &width, &height,
- INCLUDE_CSD_SIZE);
+ if (info &&
+ info->default_width > 0 &&
+ info->default_height > 0)
+ {
+ width = info->default_width;
+ height = info->default_height;
+ gtk_window_update_csd_size (window, &width, &height,
+ INCLUDE_CSD_SIZE);
+ }
+ else
+ {
+ width = nat_width;
+ height = nat_height;
+ gtk_window_update_csd_size (window, &width, &height,
+ INCLUDE_CSD_SIZE);
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]