Wireshark-dev: Re: [Wireshark-dev] FW: [Wireshark-commits] master 5330875: GTK+: Revert back to
From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Tue, 7 Oct 2014 22:38:13 +0200
2014-09-30 23:32 GMT+02:00 Gerald Combs <gerald@xxxxxxxxxxxxx>:
On 9/30/14 12:30 PM, Anders Broman wrote:
>
> Den 30 sep 2014 21:27 skrev "Gerald Combs" <gerald@xxxxxxxxxxxxx
> <mailto:gerald@xxxxxxxxxxxxx>>:
>>
>> On 9/30/14 5:00 AM, Anders Broman wrote:
>> >
>> >>      Switching to the OBS GTK+ 3.14 package. It looks like a lot of
> our GTK+ code is
>> >>    deprecated, including GtkAction and GtkAttachOptions.
>> >    Would using 3.14 work if we remove on or more of these flags from
> config.nmake?
>> >       -DGDK_DISABLE_DEPRECATED \
>> >       -DGDK_PIXBUF_DISABLE_DEPRECATED \
>> >       -DGTK_DISABLE_DEPRECATED \
>> >       -DGTK_DISABLE_SINGLE_INCLUDES \
>> >       -DGSEAL_ENABLE
>>
>> Possibly. If someone wants to experiment with this I can create GTK+
>> 3.14 bundles and check them in to the win32-libs and win64-libs trunks.
>>
>
> I think that could be useful.

Done.

Hi all,

Alexis spotted a new Win64 GTK2 crash (when scrolling fast in the packet window) seen exclusively on Win8.1 and not on Win7 (yes this also happens with the old 2.24.14 package).
So I gave a try to the GTK 3.14 package. You will find attached the patch allowing to generate the win32|64 installers. The good news is that it does not crash anymore on Win8.1. And yes Balint, it does look better on Windows :)
But there are still things that are not displayed properly (at least on Windows, my Ubuntu machine is still on 3.10.8). What I spotted on my quick test:
- half of the icons are missing in the toolbar
- no arrows in the scroll bars
- no arrows / cross in the packet panes or in the menus (like TCP StreamGraph sub menu)
- probably other things I did not discover yet
I know basically nothing about GTK coding, so I'm not sure whether this is a lot of work to fix those items or not. If  good soul is willing to take the challenge, Win8.1 users would be happy (until Qt is finished of course !).

Cheers,
Pascal.

PS: looks like the win32 build crashes in libpixman-1-0.dll. I did not investigate it yet as I'm not sure it's worth the trouble if we do not care moving to GTK3.
diff --git a/Makefile.nmake b/Makefile.nmake
index 8f25663..526eb69 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -1272,7 +1272,7 @@ install-generated-files: doc
 install-all: install-generated-files
 	set copycmd=/y
 	if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
-!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
+!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6" || "$(GTK_INST_VERSION)" == "3.14"
 	xcopy $(GTK_DIR)\bin\libgdk-3-0.dll $(INSTALL_DIR) /d
 	xcopy $(GTK_DIR)\bin\libgtk-3-0.dll $(INSTALL_DIR) /d
 !ELSE
@@ -1289,7 +1289,7 @@ install-all: install-generated-files
 	xcopy $(GTK_DIR)\$(GTK_ETC_DIR)\*.* $(INSTALL_DIR)\$(GTK_ETC_DIR) /d
 #	if not exist $(INSTALL_DIR)\etc\pango mkdir $(INSTALL_DIR)\etc\pango
 #	xcopy $(GTK_DIR)\etc\pango\pango.* $(INSTALL_DIR)\etc\pango /d
-!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
+!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6" || "$(GTK_INST_VERSION)" == "3.14"
 	if not exist $(INSTALL_DIR)\lib\gtk-3.0 mkdir $(INSTALL_DIR)\lib\gtk-3.0
 	if not exist $(INSTALL_DIR)\lib\gtk-3.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-3.0\$(GTK_LIB_DIR)
 	xcopy ".\ui\win32\settings.ini" $(INSTALL_DIR)\$(GTK_ETC_DIR) /d
@@ -1431,7 +1431,7 @@ install-all: install-generated-files
 !ENDIF
 	cd $(INSTALL_DIR)
 	peflags --dynamicbase=true --nxcompat=true *.dll
-!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
+!IF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6" || "$(GTK_INST_VERSION)" == "3.14"
 !ELSE
 	peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/*/engines/*.dll
 	peflags --dynamicbase=true --nxcompat=true lib/gtk-2.0/modules/*.dll
diff --git a/config.nmake b/config.nmake
index 088aa50..3c3f129 100644
--- a/config.nmake
+++ b/config.nmake
@@ -260,7 +260,7 @@ GLIB_VERSION=2.0
 # directory in which the "include" and "lib" directories reside.
 #
 # Set the name to gtk3 if you want to use gtk3
-GTK_NAME=gtk2
+GTK_NAME=gtk3
 GTK_DIR=$(WIRESHARK_LIB_DIR)\$(GTK_NAME)
 
 
@@ -275,7 +275,11 @@ JASPER_DLL=libjasper-1.dll
 JPEG_DLL=libjpeg-8.dll
 LZMA_DLL=liblzma-5.dll
 PIXMAN_DLL=libpixman-1-0.dll
+!IF "$(GTK_NAME)" == "gtk2"
 PNG_DLL=libpng15-15.dll
+!ELSE
+PNG_DLL=libpng16-16.dll
+!ENDIF
 SJLJ_DLL=libgcc_s_sjlj-1.dll
 TIFF_DLL=libtiff-5.dll
 XML_DLL=libxml2-2.dll
@@ -291,7 +295,7 @@ PKG_SUFIX=ws
 GDK_DLL=libgdk-3-0.dll
 GTK_DLL=libgtk-3-0.dll
 PKG_SUFIX=ws
-GTK_PKG=3.4.4-2.1
+GTK_PKG=3.14.0-2.1
 #GTK_PKG=3.6.1-1.1
 !ENDIF
 
@@ -304,7 +308,7 @@ GTK_PKG=3.4.4-2.1
 !IF "$(GTK_NAME)" == "gtk2"
 GTK_INST_VERSION=2.24
 !ELSE
-GTK_INST_VERSION=3.4
+GTK_INST_VERSION=3.14
 #GTK_INST_VERSION=3.6
 !ENDIF
 
@@ -520,21 +524,26 @@ GLIB_VERSION=2.0
 #
 #
 # Set the name to gtk3 if you want to use gtk3 - (experimental ?)
-GTK_NAME=gtk2
+GTK_NAME=gtk3
 GTK_DIR=$(WIRESHARK_LIB_DIR)\$(GTK_NAME)
 
 # These macros are used by the nsis installer script and by the install target.
 #EXPAT_DLL=libexpat-1.dll
+!IF "$(GTK_NAME)" == "gtk2"
 FFI_DLL=libffi-5.dll
+PNG_DLL=libpng15-15.dll
+!ELSE
+FFI_DLL=libffi-6.dll
+PNG_DLL=libpng16-16.dll
+HARFBUZZ_DLL=libharfbuzz-0.dll
+!ENDIF
 FONTCONFIG_DLL=libfontconfig-1.dll
 FREETYPE_DLL=libfreetype-6.dll
 INTL_DLL=libintl-8.dll
-#HARFBUZZ_DLL=libharfbuzz-0.dll
 JASPER_DLL=libjasper-1.dll
 JPEG_DLL=libjpeg-8.dll
 LZMA_DLL=liblzma-5.dll
 PIXMAN_DLL=libpixman-1-0.dll
-PNG_DLL=libpng15-15.dll
 #SEH_DLL=libgcc_s_seh-1.dll
 TIFF_DLL=libtiff-5.dll
 XML_DLL=libxml2-2.dll
@@ -550,7 +559,7 @@ PKG_SUFIX=ws
 GDK_DLL=libgdk-3-0.dll
 GTK_DLL=libgtk-3-0.dll
 PKG_SUFIX=ws
-GTK_PKG=3.4.4-2.1
+GTK_PKG=3.14.0-2.1
 #GTK_PKG=3.6.1-1.1
 !ENDIF
 
@@ -565,7 +574,7 @@ GTK_PKG=3.4.4-2.1
 GTK_INST_VERSION=2.24
 !ELSE
 #GTK_INST_VERSION=3.4
-GTK_INST_VERSION=3.6
+GTK_INST_VERSION=3.14
 !ENDIF
 
 #
@@ -760,8 +769,10 @@ GTK_MODULES_DIR=lib\gtk-2.0\modules
 GTK_THEMES_DIR=share\themes\MS-Windows\gtk-2.0
 !ELSE
 GTK_ETC_DIR=etc\gtk-3.0
+!IF "$(GTK_INST_VERSION)" != "3.14"
 GTK_SCHEMAS_DIR=\share\glib-2.0\schemas
 !ENDIF
+!ENDIF
 
 
 ##### Tools #####
@@ -1430,12 +1441,12 @@ NEED_LZMA_DLL=USE
 NEED_PIXMAN_DLL=USE
 NEED_XML_DLL=USE
 
-!ELSEIF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
+!ELSEIF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6" || "$(GTK_INST_VERSION)" == "3.14"
 
 # GTK+
 ## Note: If Wireshark is ever to be built with Gtk >= 3.10
 ##        then -DGTK_DISABLE_DEPRECATED must be removed
-##        and -DGDK_DISABLE_DEPRECIATION_WARNINGS must
+##        and -DGDK_DISABLE_DEPRECATION_WARNINGS must
 ##        be added below.
 ##       Wireshark changes to handle Gtk 3.10 deprecated features
 ##        will not be done since Wireshark is moving to Qt.
@@ -1447,7 +1458,7 @@ GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include\gtk-3.0 \
 	/I$(GTK_DIR)\include\pango-1.0 \
 	-DGDK_DISABLE_DEPRECATED \
 	-DGDK_PIXBUF_DISABLE_DEPRECATED \
-	-DGTK_DISABLE_DEPRECATED \
+	-DGDK_DISABLE_DEPRECATION_WARNINGS \
 	-DGTK_DISABLE_SINGLE_INCLUDES \
 	-DGSEAL_ENABLE
 GTK_LIBS=$(GTK_DIR)\lib\gtk-3.lib \