[mingw-gtk-vnc] Add patch to avoid crash on Windows (using GTK3)

Fabiano FidĂȘncio fidencio at fedoraproject.org
Wed Feb 18 13:54:32 UTC 2015


commit f2147b120a5b2ae6788edc54d0e3846e1984fb2a
Author: Fabiano FidĂȘncio <fidencio at redhat.com>
Date:   Wed Feb 18 13:03:10 2015 +0100

    Add patch to avoid crash on Windows (using GTK3)

 ...check-whether-the-widget-is-realized-in-f.patch |   29 ++++++++++++++++++++
 mingw-gtk-vnc.spec                                 |   11 +++++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/0001-vncdisplay-check-whether-the-widget-is-realized-in-f.patch b/0001-vncdisplay-check-whether-the-widget-is-realized-in-f.patch
new file mode 100644
index 0000000..80207a2
--- /dev/null
+++ b/0001-vncdisplay-check-whether-the-widget-is-realized-in-f.patch
@@ -0,0 +1,29 @@
+From c7ff8790ec0733c384a8f32dd9ee9ca945dd512e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio at redhat.com>
+Date: Wed, 18 Feb 2015 14:27:11 +0100
+Subject: [PATCH] vncdisplay: check whether the widget is realized in
+ focus_in_event()
+
+Returning early on focus_in_event(), when widget is not realized, avoids
+segfault when running on Windows using GTK3.
+---
+ src/vncdisplay.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/vncdisplay.c b/src/vncdisplay.c
+index d8afba2..cd4dc4a 100644
+--- a/src/vncdisplay.c
++++ b/src/vncdisplay.c
+@@ -1114,6 +1114,9 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
+     if (priv->conn == NULL || !vnc_connection_is_initialized(priv->conn))
+         return FALSE;
+ 
++    if (!gtk_widget_get_realized(widget))
++        return TRUE;
++
+ #ifdef G_OS_WIN32
+     win32_window = GDK_WINDOW_HWND(gtk_widget_get_window(widget));
+ #endif
+-- 
+2.1.0
+
diff --git a/mingw-gtk-vnc.spec b/mingw-gtk-vnc.spec
index 11c73a8..36dcbd2 100644
--- a/mingw-gtk-vnc.spec
+++ b/mingw-gtk-vnc.spec
@@ -2,7 +2,7 @@
 
 Name: mingw-gtk-vnc
 Version: 0.5.4
-Release: 1%{?dist}%{?extra_release}
+Release: 2%{?dist}%{?extra_release}
 Summary: MinGW Windows port of VNC client GTK widget
 
 License: LGPLv2+
@@ -10,6 +10,8 @@ Group: Development/Libraries
 Source: http://ftp.gnome.org/pub/GNOME/sources/gtk-vnc/0.5/gtk-vnc-%{version}.tar.xz
 URL: http://live.gnome.org/gtk-vnc
 
+Patch0001:      0001-vncdisplay-check-whether-the-widget-is-realized-in-f.patch
+
 BuildArch: noarch
 
 BuildRequires: mingw32-filesystem >= 95
@@ -122,6 +124,10 @@ allowing it to be completely asynchronous while remaining single threaded.
 
 %prep
 %setup -q -n gtk-vnc-%{version} -c
+pushd gtk-vnc-%{version}
+%patch0001 -p1
+popd
+
 touch gtk-vnc-%{version}/GNUmakefile
 cp -a gtk-vnc-%{version} gtk-vnc2-%{version}
 
@@ -224,6 +230,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
 
 
 %changelog
+* Wed Feb 18 2015 Fabiano FidĂȘncio <fidencio at redhat.com> - 0.5.4-2
+- Add patch to avoid crash on Windows (using GTK3)
+
 * Tue Feb 10 2015 Daniel P. Berrange <berrange at redhat.com> - 0.5.4-1
 - Update to 0.5.4 release
 


More information about the scm-commits mailing list