a4ade77
From a97553a939b76df1564ffbfe9c919d1da5a34c5a Mon Sep 17 00:00:00 2001
a4ade77
From: Paul Cornett <paulcor@users.noreply.github.com>
a4ade77
Date: Mon, 21 Mar 2016 09:46:46 -0700
a4ade77
Subject: [PATCH] Avoid unresizable windows on HiDPI displays when using
a4ade77
 SetSizeHints()
a4ade77
a4ade77
see #17456
a4ade77
a4ade77
(cherry picked from commit 4793e5b0a4e189e492287305859b278fed780080)
a4ade77
---
a4ade77
 src/gtk/toplevel.cpp | 5 +++--
a4ade77
 1 file changed, 3 insertions(+), 2 deletions(-)
a4ade77
a4ade77
diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp
a4ade77
index 464fb3f..69fca2a 100644
a4ade77
--- a/src/gtk/toplevel.cpp
a4ade77
+++ b/src/gtk/toplevel.cpp
a4ade77
@@ -1273,8 +1273,9 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
a4ade77
     int hints_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
a4ade77
     hints.min_width = 1;
a4ade77
     hints.min_height = 1;
a4ade77
-    hints.max_width = INT_MAX;
a4ade77
-    hints.max_height = INT_MAX;
a4ade77
+    // using INT_MAX for size will lead to integer overflow with HiDPI scaling
a4ade77
+    hints.max_width = INT_MAX / 16;
a4ade77
+    hints.max_height = INT_MAX / 16;
a4ade77
     int decorSize_x;
a4ade77
     int decorSize_y;
a4ade77
 #ifdef HAS_CLIENT_DECOR