From mboxrd@z Thu Jan 1 00:00:00 1970 From: rennes Subject: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client. Date: Thu, 9 Feb 2017 10:36:16 -0600 Message-ID: <20170209163618.1759-2-rennes@openmailbox.org> References: <20170209163618.1759-1-rennes@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbriM-0007Mp-4n for guix-devel@gnu.org; Thu, 09 Feb 2017 11:36:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbriI-0007fX-QJ for guix-devel@gnu.org; Thu, 09 Feb 2017 11:36:58 -0500 Received: from lb1.openmailbox.org ([5.79.108.160]:55828 helo=mail.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbriI-0007eM-FC for guix-devel@gnu.org; Thu, 09 Feb 2017 11:36:54 -0500 In-Reply-To: <20170209163618.1759-1-rennes@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 3 +- gnu/packages/patches/wxwidgets-fix-windowGTK.patch | 35 ++++++++++++++++= ++++++ gnu/packages/wxwidgets.scm | 5 +++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/wxwidgets-fix-windowGTK.patch diff --git a/gnu/local.mk b/gnu/local.mk index 63ce3af71..d94cede10 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -5,7 +5,7 @@ # Copyright =C2=A9 2013, 2014, 2015, 2016 Mark H Weaver # Copyright =C2=A9 2016 Chris Marusich # Copyright =C2=A9 2016 Kei Kebreau -# Copyright =C2=A9 2016 Rene Saavedra +# Copyright =C2=A9 2016, 2017 Rene Saavedra # Copyright =C2=A9 2016 Adonay "adfeno" Felipe Nogueira # Copyright =C2=A9 2016, 2017 Ricardo Wurmus # Copyright =C2=A9 2016 Ben Woodcroft @@ -957,6 +957,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/wordnet-CVE-2008-2149.patch \ %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch \ %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch \ + %D%/packages/patches/wxwidgets-fix-windowGTK.patch \ %D%/packages/patches/xdotool-fix-makefile.patch \ %D%/packages/patches/xf86-video-ark-remove-mibstore.patch \ %D%/packages/patches/xf86-video-ast-remove-mibstore.patch \ diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch b/gnu/pac= kages/patches/wxwidgets-fix-windowGTK.patch new file mode 100644 index 000000000..05e2e5819 --- /dev/null +++ b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch @@ -0,0 +1,35 @@ +This patch allow Filezilla client to resize window. + +Authors: Tim Kosse +Upstream status: This issue was fixed in master branch. +Ticket: '' + +From 3a52125f81d28fcad5d3c841b94a3e4bad295d9e Mon Sep 17 00:00:00 2001 +From: Tim Kosse +Date: Sun, 20 Mar 2016 10:22:13 +0100 +Subject: [PATCH] Fix wxTopLevelWindowGTK::DoSetSizeHints if a window sca= le +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 =3D GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE; + hints.min_width =3D 1; + hints.min_height =3D 1; +- hints.max_width =3D INT_MAX; +- hints.max_height =3D 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 =3D INT_MAX / 16; ++ hints.max_height =3D INT_MAX / 16; + const int decorSize_x =3D m_decorSize.left + m_decorSize.right; + const int decorSize_y =3D m_decorSize.top + m_decorSize.bottom; + if (minSize.x > decorSize_x) diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index 5285037ff..52fa8184d 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm @@ -3,6 +3,7 @@ ;;; Copyright =C2=A9 2016 Ricardo Wurmus ;;; Copyright =C2=A9 2016 Theodoros Foradis ;;; Copyright =C2=A9 2016 Danny Milosavljevic +;;; Copyright =C2=A9 2017 Rene Saavedra ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,7 +51,9 @@ "releases/download/v" version "/wxWidgets-" version ".tar.bz2")) (sha256 - (base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))= )) + (base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l")) + (patches (search-patches + "wxwidgets-fix-windowGTK.patch")))) (build-system glib-or-gtk-build-system) (inputs `(("glu" ,glu) --=20 2.11.0