unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 05e2e5819a08d5e5eb56af0fc1ddb95fada86c0d 1462 bytes (raw)
name: gnu/packages/patches/wxwidgets-fix-windowGTK.patch 	 # note: path name is non-authoritative(*)

 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)

debug log:

solving 05e2e5819 ...
found 05e2e5819 in https://yhetil.org/guix-devel/20170209163618.1759-2-rennes@openmailbox.org/

applying [1/1] https://yhetil.org/guix-devel/20170209163618.1759-2-rennes@openmailbox.org/
diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
new file mode 100644
index 000000000..05e2e5819

Checking patch gnu/packages/patches/wxwidgets-fix-windowGTK.patch...
Applied patch gnu/packages/patches/wxwidgets-fix-windowGTK.patch cleanly.

index at:
100644 05e2e5819a08d5e5eb56af0fc1ddb95fada86c0d	gnu/packages/patches/wxwidgets-fix-windowGTK.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).