[mingw-spice-gtk/f21] Add patch to avoid crash on Windows, when using GTK3

Fabiano Fidêncio fidencio at fedoraproject.org
Thu Nov 27 16:19:26 UTC 2014


commit f9e6b16fbcc39b67bff7d816080103f8d4c079fb
Author: Fabiano Fidêncio <fidencio at redhat.com>
Date:   Thu Nov 27 17:17:50 2014 +0100

    Add patch to avoid crash on Windows, when using GTK3

 ...t-check-whether-the-widget-is-realized-in.patch |   43 ++++++++++++++++++++
 mingw-spice-gtk.spec                               |    7 +++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/0001-spice-widget-check-whether-the-widget-is-realized-in.patch b/0001-spice-widget-check-whether-the-widget-is-realized-in.patch
new file mode 100644
index 0000000..1eabeb2
--- /dev/null
+++ b/0001-spice-widget-check-whether-the-widget-is-realized-in.patch
@@ -0,0 +1,43 @@
+From 0d9982c3b098f3ab7a8ffc80ab43d4781c594fc7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio at redhat.com>
+Date: Wed, 26 Nov 2014 15:39:24 +0100
+Subject: [PATCH] spice-widget: 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.
+
+Program received signal SIGSEGV, Segmentation fault.
+_gdk_windows_has_impl <window=window at entry=0x0> at gdkwindow.c:584
+<gdb> bt
+ #0  _gdk_window_has_impl (window=window at entry=0x0) at gdkwindow.c:584
+ #1  0x70f02821 in gdk_win32_window_get_handle (window=0x0) at
+     gdkwindow-win32.c:3459
+ #2  0x00c759ef in update_display (display=0x1b18440) at
+     spice-widget.c:1297
+ #3  0x00c77280 in focus_in_event (widget=0x1b18440, focus=0x1b02b68) at
+     spice-widget.c:1462
+ #4  0x665727f5 in ?? () from C:\Program Files\VirtViewer
+     (GTK3)\bin\libgtk-3-0.dll
+ #5  0x00000000 in ?? ()
+---
+ gtk/spice-widget.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
+index ae11073..87fd462 100644
+--- a/gtk/spice-widget.c
++++ b/gtk/spice-widget.c
+@@ -1447,6 +1447,9 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
+ 
+     SPICE_DEBUG("%s", __FUNCTION__);
+ 
++    if (!gtk_widget_get_realized(widget))
++        return true;
++
+     /*
+      * Ignore focus in when we already have the focus
+      * (this happens when doing an ungrab from the leave_event callback).
+-- 
+2.1.0
+
diff --git a/mingw-spice-gtk.spec b/mingw-spice-gtk.spec
index b84f6ef..42eaaad 100644
--- a/mingw-spice-gtk.spec
+++ b/mingw-spice-gtk.spec
@@ -2,12 +2,13 @@
 
 Name:           mingw-spice-gtk
 Version:        0.26
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A GTK+ widget for SPICE clients
 
 License:        LGPLv2+
 URL:            http://spice-space.org/page/Spice-Gtk
 Source0:        http://www.spice-space.org/download/gtk/spice-gtk-%{version}%{?_version_suffix}.tar.bz2
+Patch1: 0001-spice-widget-check-whether-the-widget-is-realized-in.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
@@ -124,6 +125,7 @@ Gtk+ client static libraries for SPICE desktop servers.
 %prep
 %setup -q -n spice-gtk-%{version}%{?_version_suffix} -c
 pushd spice-gtk-%{version}%{?_version_suffix}
+%patch1 -p1
 popd
 
 if [ -n '%{?_version_suffix}' ]; then
@@ -275,6 +277,9 @@ rm -rf $RPM_BUILD_ROOT
 %{mingw64_mandir}/man1/spice-client.1*
 
 %changelog
+* Thu Nov 27 2014 Fabiano Fidêncio <fidencio at redhat.com> - 0.26.2
+- Add patch to avoid crash on Windows, when using GTK3
+
 * Wed Oct 29 2014 Fabiano Fidêncio <fidencio at redhat.com> - 0.26-1
 - Update to spice-gtk 0.26
 


More information about the scm-commits mailing list