From eae0b7ccb4536433fe84e787e36253b8a7e02fa5a27605ba192301cd35de4e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Fri, 10 Mar 2023 20:51:50 +0000 Subject: [PATCH] Accepting request 1070735 from GNOME:Next - Add 3e3158ce12741b58ce53f132b48f26438094886d.patch: widget: Use the correct template in dispose_template(). Fixes crashes in various apps. - Refresh patches with quilt. OBS-URL: https://build.opensuse.org/request/show/1070735 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk4?expand=0&rev=119 --- ...on-Simplify-pkgconfig-file-generator.patch | 21 ++++++-------- ...58ce12741b58ce53f132b48f26438094886d.patch | 29 +++++++++++++++++++ gtk4.changes | 8 +++++ gtk4.spec | 2 ++ 4 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 3e3158ce12741b58ce53f132b48f26438094886d.patch diff --git a/0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch b/0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch index 7593e42..f4935b0 100644 --- a/0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch +++ b/0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch @@ -13,11 +13,11 @@ This reverts commit 802bf4199911c811938b0454a876089bafa97dba. meson.build | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) -diff --git a/meson.build b/meson.build -index 1b8f2d0248..4fc808dbd4 100644 ---- a/meson.build -+++ b/meson.build -@@ -471,6 +471,9 @@ if not os_win32 +Index: gtk-4.10.0/meson.build +=================================================================== +--- gtk-4.10.0.orig/meson.build ++++ gtk-4.10.0/meson.build +@@ -431,6 +431,9 @@ if not os_win32 endif endif @@ -27,7 +27,7 @@ index 1b8f2d0248..4fc808dbd4 100644 cairo_backends = [] foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], ['cairo-win32', cairo_req, win32_enabled], -@@ -601,14 +604,26 @@ if x11_enabled +@@ -559,14 +562,26 @@ if x11_enabled cdata.set('HAVE_RANDR15', xrandr15_dep.found()) endif @@ -54,7 +54,7 @@ index 1b8f2d0248..4fc808dbd4 100644 # Check whether libepoxy is built with EGL support on Windows endif -@@ -826,7 +841,16 @@ gsk_private_packages = [] # all already in gdk_private_packages +@@ -791,7 +806,16 @@ gsk_private_packages = [] # all already pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : [] gtk_private_packages = pangoft2_pkgs @@ -72,7 +72,7 @@ index 1b8f2d0248..4fc808dbd4 100644 pkg_targets = [] display_backends = [] foreach backend: [ 'broadway', 'macos', 'wayland', 'win32', 'x11', ] -@@ -843,23 +867,18 @@ common_pc_variables = [ +@@ -808,23 +832,18 @@ common_pc_variables = [ 'gtk_host=@0@-@1@'.format(host_machine.cpu_family(), host_machine.system()), # FIXME ] @@ -102,7 +102,7 @@ index 1b8f2d0248..4fc808dbd4 100644 ) meson.override_dependency(pkg, libgtk_dep) endforeach -@@ -870,10 +889,10 @@ if os_unix +@@ -835,10 +854,10 @@ if os_unix unescaped_variables: common_pc_variables, name: 'GTK', description: 'GTK Unix print support', @@ -115,6 +115,3 @@ index 1b8f2d0248..4fc808dbd4 100644 endif subdir('po') --- -2.37.1 - diff --git a/3e3158ce12741b58ce53f132b48f26438094886d.patch b/3e3158ce12741b58ce53f132b48f26438094886d.patch new file mode 100644 index 0000000..adea3e5 --- /dev/null +++ b/3e3158ce12741b58ce53f132b48f26438094886d.patch @@ -0,0 +1,29 @@ +From 9b3fb66bd4568c05f4bd10bda7f6cc1d2ed6919e Mon Sep 17 00:00:00 2001 +From: Alexander Mikhaylenko +Date: Mon, 6 Mar 2023 05:36:16 +0400 +Subject: [PATCH] widget: Use the correct template in dispose_template() + +In derivable classes, the widget's class can be different from the one +dispose_template() was called for, which can lead to failing the +template != NULL check at best, undefined behavior at worst. + +Since we already pass the correct GType into the function, just use that +instead. +--- + gtk/gtkwidget.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: gtk-4.10.0/gtk/gtkwidget.c +=================================================================== +--- gtk-4.10.0.orig/gtk/gtkwidget.c ++++ gtk-4.10.0/gtk/gtkwidget.c +@@ -11180,7 +11180,8 @@ gtk_widget_dispose_template (GtkWidget * + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (g_type_name (widget_type) != NULL); + +- GtkWidgetTemplate *template = GTK_WIDGET_GET_CLASS (widget)->priv->template; ++ GObjectClass *object_class = g_type_class_peek (widget_type); ++ GtkWidgetTemplate *template = GTK_WIDGET_CLASS (object_class)->priv->template; + g_return_if_fail (template != NULL); + + /* Tear down the automatic child data */ diff --git a/gtk4.changes b/gtk4.changes index af87610..e3e1e64 100644 --- a/gtk4.changes +++ b/gtk4.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Mar 10 09:23:22 UTC 2023 - Bjørn Lie + +- Add 3e3158ce12741b58ce53f132b48f26438094886d.patch: widget: Use + the correct template in dispose_template(). Fixes crashes in + various apps. +- Refresh patches with quilt. + ------------------------------------------------------------------- Thu Mar 9 07:36:45 UTC 2023 - Xiaoguang Wang diff --git a/gtk4.spec b/gtk4.spec index c655ea3..ab40dfb 100644 --- a/gtk4.spec +++ b/gtk4.spec @@ -41,6 +41,8 @@ Source99: gtk4-rpmlintrc Patch0: 0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch # PATCH-FIX-UPSTREAM 0001-combobox-Avoid-extra-queue_resize.patch bsc#1209043 glgo#GNOME/gtk!5608 xwang@suse.com -- combobox: Avoid extra queue_resize() Patch1: 0001-combobox-Avoid-extra-queue_resize.patch +# PATCH-FIX-UPSTREAM https://gitlab.gnome.org/GNOME/gtk/-/commit/3e3158ce12741b58ce53f132b48f26438094886d.patch -- widget: Use the correct template in dispose_template() +Patch2: 3e3158ce12741b58ce53f132b48f26438094886d.patch BuildRequires: cups-devel >= 2.0 # We do not support building against cups 2.3 betas