Backport a GtkBuilder fix to ensure types get fully initialized
This commit is contained in:
parent
74ffd8d58b
commit
d743173952
39
0003-GtkBuilder-Ensure-types-are-fully-initialized.patch
Normal file
39
0003-GtkBuilder-Ensure-types-are-fully-initialized.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
From 6de6656d1f8d762093fe9d73f2713380573b9e39 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthias Clasen <mclasen@redhat.com>
|
||||||
|
Date: Fri, 30 May 2014 12:39:07 -0400
|
||||||
|
Subject: [PATCH] GtkBuilder: Ensure types are fully initialized
|
||||||
|
|
||||||
|
Just calling get_type() does not ensure that the signals, properties
|
||||||
|
and everything else gets set up properly. Ensure it is, by calling
|
||||||
|
g_type_class_ref() before using the type. This fixes the testcase
|
||||||
|
added in the previous commit.
|
||||||
|
---
|
||||||
|
gtk/gtkbuilder.c | 9 ++++++++-
|
||||||
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
|
||||||
|
index f6e5c52..60927df 100644
|
||||||
|
--- a/gtk/gtkbuilder.c
|
||||||
|
+++ b/gtk/gtkbuilder.c
|
||||||
|
@@ -2275,10 +2275,17 @@ GType
|
||||||
|
gtk_builder_get_type_from_name (GtkBuilder *builder,
|
||||||
|
const gchar *type_name)
|
||||||
|
{
|
||||||
|
+ GType type;
|
||||||
|
+
|
||||||
|
g_return_val_if_fail (GTK_IS_BUILDER (builder), G_TYPE_INVALID);
|
||||||
|
g_return_val_if_fail (type_name != NULL, G_TYPE_INVALID);
|
||||||
|
|
||||||
|
- return GTK_BUILDER_GET_CLASS (builder)->get_type_from_name (builder, type_name);
|
||||||
|
+ type = GTK_BUILDER_GET_CLASS (builder)->get_type_from_name (builder, type_name);
|
||||||
|
+
|
||||||
|
+ if (G_TYPE_IS_CLASSED (type))
|
||||||
|
+ g_type_class_unref (g_type_class_ref (type));
|
||||||
|
+
|
||||||
|
+ return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
--
|
||||||
|
2.0.0
|
||||||
|
|
@ -17,7 +17,7 @@
|
|||||||
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
|
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
|
||||||
Name: gtk3
|
Name: gtk3
|
||||||
Version: 3.13.2
|
Version: 3.13.2
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
URL: http://www.gtk.org
|
URL: http://www.gtk.org
|
||||||
@ -27,6 +27,7 @@ Source: http://download.gnome.org/sources/gtk+/3.13/gtk+-%{version}.tar.xz
|
|||||||
# Backports from git master
|
# Backports from git master
|
||||||
Patch1: 0001-eventcontroller-Ensure-controllers-stay-alive-during.patch
|
Patch1: 0001-eventcontroller-Ensure-controllers-stay-alive-during.patch
|
||||||
Patch2: 0002-Revert-GtkMisc-Keep-gtk_misc_set_alignment-working.patch
|
Patch2: 0002-Revert-GtkMisc-Keep-gtk_misc_set_alignment-working.patch
|
||||||
|
Patch3: 0003-GtkBuilder-Ensure-types-are-fully-initialized.patch
|
||||||
|
|
||||||
BuildRequires: gnome-common autoconf automake intltool gettext
|
BuildRequires: gnome-common autoconf automake intltool gettext
|
||||||
BuildRequires: atk-devel >= %{atk_version}
|
BuildRequires: atk-devel >= %{atk_version}
|
||||||
@ -144,6 +145,7 @@ the functionality of the installed %{name} package.
|
|||||||
%setup -q -n gtk+-%{version}
|
%setup -q -n gtk+-%{version}
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -309,6 +311,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
|
|||||||
%{_datadir}/installed-tests
|
%{_datadir}/installed-tests
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 30 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.2-3
|
||||||
|
- Backport a GtkBuilder fix to ensure types get fully initialized
|
||||||
|
|
||||||
* Fri May 30 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.2-2
|
* Fri May 30 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.2-2
|
||||||
- Backport two fixes from git master
|
- Backport two fixes from git master
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user