1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| | This patch allow Filezilla client to resize window.
Authors: Tim Kosse <tim.kosse@filezilla-project.org>
Upstream status: This issue was fixed in master branch.
Ticket: '<http://trac.wxwidgets.org/ticket/17456>'
From 3a52125f81d28fcad5d3c841b94a3e4bad295d9e Mon Sep 17 00:00:00 2001
From: Tim Kosse <tim.kosse@filezilla-project.org>
Date: Sun, 20 Mar 2016 10:22:13 +0100
Subject: [PATCH] Fix wxTopLevelWindowGTK::DoSetSizeHints if a window scale
factor larger than 1 is set.
In this case, passing INT_MAX as maximum width/height hint
to gtk_window_set_geometry_hints leads to integer overlows.
Instead, use INT_MAX / 16 which should work with all
resonable scale factors.
--- a/src/gtk/toplevel.cpp 2014-10-06 16:33:44.000000000 -0500
+++ b/src/gtk/toplevel.cpp 2017-02-07 20:44:07.382988282 -0600
@@ -1216,8 +1216,12 @@
int hints_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
hints.min_width = 1;
hints.min_height = 1;
- hints.max_width = INT_MAX;
- hints.max_height = INT_MAX;
+ // Due to HiDPI UI scale, using INT_MAX leads to integer
+ // overflows when calculating the actual window size.
+ // Divide by 16 to to accomodate crazy high scale factors
+ // without overflowing.
+ hints.max_width = INT_MAX / 16;
+ hints.max_height = INT_MAX / 16;
const int decorSize_x = m_decorSize.left + m_decorSize.right;
const int decorSize_y = m_decorSize.top + m_decorSize.bottom;
if (minSize.x > decorSize_x)
|