diff --git a/SOURCES/0001-gdkwindow-Handle-references-in-update_windows-list-c.patch b/SOURCES/0001-gdkwindow-Handle-references-in-update_windows-list-c.patch new file mode 100644 index 0000000..07f7ec1 --- /dev/null +++ b/SOURCES/0001-gdkwindow-Handle-references-in-update_windows-list-c.patch @@ -0,0 +1,85 @@ +From c212cb8f32c02cf2fe691372b753d334f6e25d69 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Mon, 16 Dec 2013 18:04:14 +0100 +Subject: [PATCH 1/2] gdkwindow: Handle references in "update_windows" list + correctly + +Since update_windows list is a static variable in GdkWindow.c which +contains pointers to windows which needs to be updated, it can happen +that it contains a pointer to a window even after quit from a gtk_main(). +If another gtk_main() is called in the same process it tries to process +windows in the list which leads to a crash. +Correct reference count handling of added windows prevents such applications +from crash. + +https://bugzilla.gnome.org/show_bug.cgi?id=711552 +--- + gdk/gdkwindow.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c +index f5f0339..0f33fb0 100644 +--- a/gdk/gdkwindow.c ++++ b/gdk/gdkwindow.c +@@ -5267,7 +5267,7 @@ gdk_window_add_update_window (GdkWindow *window) + prev = tmp; + } + /* here, tmp got advanced past all lower stacked siblings */ +- tmp = g_slist_prepend (tmp, window); ++ tmp = g_slist_prepend (tmp, g_object_ref (window)); + if (prev) + prev->next = tmp; + else +@@ -5280,7 +5280,7 @@ gdk_window_add_update_window (GdkWindow *window) + */ + if (has_ancestor_in_list && gdk_window_is_ancestor (tmp->data, window)) + { +- tmp = g_slist_prepend (tmp, window); ++ tmp = g_slist_prepend (tmp, g_object_ref (window)); + + if (prev) + prev->next = tmp; +@@ -5294,7 +5294,7 @@ gdk_window_add_update_window (GdkWindow *window) + */ + if (! tmp->next && has_ancestor_in_list) + { +- tmp = g_slist_append (tmp, window); ++ tmp = g_slist_append (tmp, g_object_ref (window)); + return; + } + +@@ -5305,13 +5305,20 @@ gdk_window_add_update_window (GdkWindow *window) + * hierarchy than what is already in the list) or the list is + * empty, prepend + */ +- update_windows = g_slist_prepend (update_windows, window); ++ update_windows = g_slist_prepend (update_windows, g_object_ref (window)); + } + + static void + gdk_window_remove_update_window (GdkWindow *window) + { +- update_windows = g_slist_remove (update_windows, window); ++ GSList *link; ++ ++ link = g_slist_find (update_windows, window); ++ if (link != NULL) ++ { ++ update_windows = g_slist_delete_link (update_windows, link); ++ g_object_unref (window); ++ } + } + + static gboolean +@@ -5687,8 +5694,6 @@ gdk_window_process_all_updates (void) + + _gdk_windowing_before_process_all_updates (); + +- g_slist_foreach (old_update_windows, (GFunc)g_object_ref, NULL); +- + while (tmp_list) + { + GdkWindowObject *private = (GdkWindowObject *)tmp_list->data; +-- +1.8.4.2 + diff --git a/SOURCES/0002-gdkwindow-Don-t-add-the-same-window-to-update_window.patch b/SOURCES/0002-gdkwindow-Don-t-add-the-same-window-to-update_window.patch new file mode 100644 index 0000000..ee08344 --- /dev/null +++ b/SOURCES/0002-gdkwindow-Don-t-add-the-same-window-to-update_window.patch @@ -0,0 +1,36 @@ +From 090159cec92921182f8eeb59762ceba11c1581f4 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Wed, 18 Dec 2013 18:28:39 +0100 +Subject: [PATCH 2/2] gdkwindow: Don't add the same window to "update_windows" + twice + +This prevents passing of such window to another GMainLoop. + +https://bugzilla.gnome.org/show_bug.cgi?id=711552 +--- + gdk/gdkwindow.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c +index 0f33fb0..153144a 100644 +--- a/gdk/gdkwindow.c ++++ b/gdk/gdkwindow.c +@@ -5242,6 +5242,15 @@ gdk_window_add_update_window (GdkWindow *window) + GSList *prev = NULL; + gboolean has_ancestor_in_list = FALSE; + ++ /* Check whether "window" is already in "update_windows" list. ++ * It could be added during execution of gtk_widget_destroy() when ++ * setting focus widget to NULL and redrawing old focus widget. ++ * See bug 711552. ++ */ ++ tmp = g_slist_find (update_windows, window); ++ if (tmp != NULL) ++ return; ++ + for (tmp = update_windows; tmp; tmp = tmp->next) + { + GdkWindowObject *parent = GDK_WINDOW_OBJECT (window)->parent; +-- +1.8.4.2 + diff --git a/SOURCES/update-gtk-immodules b/SOURCES/update-gtk-immodules index fbc743f..f53cbc2 100755 --- a/SOURCES/update-gtk-immodules +++ b/SOURCES/update-gtk-immodules @@ -40,7 +40,7 @@ fi FILE=/etc/gtk-2.0/$host/gtk.immodules case "$host" in - alpha*|ia64*|powerpc64*|s390x*|x86_64*) + alpha*|ia64*|powerpc64*|s390x*|x86_64*|aarch64*) /usr/bin/gtk-query-immodules-2.0-64 > $FILE ;; *) diff --git a/SPECS/gtk2.spec b/SPECS/gtk2.spec index fd4b530..049c631 100644 --- a/SPECS/gtk2.spec +++ b/SPECS/gtk2.spec @@ -18,7 +18,7 @@ Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X Name: gtk2 Version: 2.24.22 -Release: 1%{?dist} +Release: 5%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -36,6 +36,9 @@ Patch2: icon-padding.patch Patch8: tooltip-positioning.patch # https://bugzilla.gnome.org/show_bug.cgi?id=611313 Patch15: window-dragging.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1054751 +Patch31: 0001-gdkwindow-Handle-references-in-update_windows-list-c.patch +Patch32: 0002-gdkwindow-Don-t-add-the-same-window-to-update_window.patch BuildRequires: atk-devel >= %{atk_version} BuildRequires: glib2-devel >= %{glib2_version} @@ -147,6 +150,8 @@ This package contains developer documentation for the GTK+ widget toolkit. %patch2 -p1 -b .icon-padding %patch8 -p1 -b .tooltip-positioning %patch15 -p1 -b .window-dragging +%patch31 -p1 -b .gdkwindow-Handle-references +%patch32 -p1 -b .gdkwindow-Don-t-add %build (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi; @@ -223,7 +228,7 @@ done # for places where we have two copies of the GTK+ package installed. # (we might have x86_64 and i686 packages on the same system, for example.) case "$host" in - alpha*|ia64*|ppc64*|powerpc64*|s390x*|x86_64*) + alpha*|ia64*|ppc64*|powerpc64*|s390x*|x86_64*|aarch64*) mv $RPM_BUILD_ROOT%{_bindir}/gtk-query-immodules-2.0 $RPM_BUILD_ROOT%{_bindir}/gtk-query-immodules-2.0-64 ;; *) @@ -333,6 +338,20 @@ gtk-query-immodules-2.0-%{__isa_bits} --update-cache %doc tmpdocs/examples %changelog +* Fri Jan 24 2014 Daniel Mach - 2.24.22-5 +- Mass rebuild 2014-01-24 + +* Fri Jan 17 2014 Benjamin Otte 2.24.22-4 +- Mass rebuild 2013-12-27 +- Resolves: #1054751 + +* Fri Dec 27 2013 Daniel Mach - 2.24.22-3 +- Mass rebuild 2013-12-27 + +* Mon Nov 11 2013 Matthias Clasen - 2.24.22-2 +- Fix build on aarch64 +- Resolves: #1028579 + * Tue Oct 29 2013 Matthias Clasen - 2.24.22-1 - Update to 2.24.22 - Resolves: #1018303