From 3f4adb72fa4dcd1e1d30d558b78f18ada5c17447 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 11 Nov 2025 15:38:18 +0000 Subject: [PATCH] import UBI gtk3-3.24.31-8.el9 --- ...tiate-keypad-keysyms-in-accelerators.patch | 68 +++++++++++++++++++ ...0001-dnd-Prevent-a-possible-segfault.patch | 37 ++++++++++ ...cellabel-Differentiate-keypad-better.patch | 28 ++++++++ ...utwindow-Differentiate-keypad-better.patch | 49 +++++++++++++ SOURCES/remove-size-allocation-critical.patch | 11 +++ SPECS/gtk3.spec | 22 +++++- 6 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-Differentiate-keypad-keysyms-in-accelerators.patch create mode 100644 SOURCES/0001-dnd-Prevent-a-possible-segfault.patch create mode 100644 SOURCES/0002-accellabel-Differentiate-keypad-better.patch create mode 100644 SOURCES/0003-shortcutwindow-Differentiate-keypad-better.patch create mode 100644 SOURCES/remove-size-allocation-critical.patch diff --git a/SOURCES/0001-Differentiate-keypad-keysyms-in-accelerators.patch b/SOURCES/0001-Differentiate-keypad-keysyms-in-accelerators.patch new file mode 100644 index 0000000..47c5451 --- /dev/null +++ b/SOURCES/0001-Differentiate-keypad-keysyms-in-accelerators.patch @@ -0,0 +1,68 @@ +From 6cc0552ab8efe0b11f3db21224520dc97db17d9f Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Thu, 27 Oct 2022 11:49:03 -0400 +Subject: [PATCH] Differentiate keypad keysyms in accelerators + +When displaying accelerators, differentiate keypad +symbols with a 'KP' prefix. Fixing a 17 year old bug. + +Backport of c58d9446f40b36136f25baf. +--- + gtk/gtkaccellabel.c | 11 +++++++++++ + testsuite/gtk/accel.c | 6 ++++-- + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c +index 0e2c50bb67..75b27a8726 100644 +--- a/gtk/gtkaccellabel.c ++++ b/gtk/gtkaccellabel.c +@@ -883,6 +883,17 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass, + if (seen_mod) + g_string_append (gstring, klass->mod_separator); + ++ if (accelerator_key >= GDK_KEY_KP_Space && ++ accelerator_key <= GDK_KEY_KP_Equal) ++ { ++ /* Translators: "KP" means "numeric key pad". This string will ++ * be used in accelerators such as "Ctrl+Shift+KP 1" in menus, ++ * and therefore the translation needs to be very short. ++ */ ++ g_string_append (gstring, C_("keyboard label", "KP")); ++ g_string_append (gstring, " "); ++ } ++ + switch (ch) + { + case ' ': +diff --git a/testsuite/gtk/accel.c b/testsuite/gtk/accel.c +index da031da7be..d6ea0bc252 100644 +--- a/testsuite/gtk/accel.c ++++ b/testsuite/gtk/accel.c +@@ -55,6 +55,8 @@ test_one_accel (const char *accel, + *keycodes, + mods); + ++ g_print ("accel %s, label %s\n", accel, label); ++ + g_assert_cmpstr (label, ==, exp_label); + + name = gtk_accelerator_name_with_keycode (NULL, +@@ -83,13 +85,13 @@ accel2 (void) + static void + accel3 (void) + { +- test_one_accel ("KP_7", "7", TRUE); ++ test_one_accel ("KP_7", "KP 7", TRUE); + } + + static void + accel4 (void) + { +- test_one_accel ("KP_7", "Ctrl+7", TRUE); ++ test_one_accel ("KP_7", "Ctrl+KP 7", TRUE); + } + + static void +-- +2.49.0 + diff --git a/SOURCES/0001-dnd-Prevent-a-possible-segfault.patch b/SOURCES/0001-dnd-Prevent-a-possible-segfault.patch new file mode 100644 index 0000000..63d0361 --- /dev/null +++ b/SOURCES/0001-dnd-Prevent-a-possible-segfault.patch @@ -0,0 +1,37 @@ +From 889057a38627acb711ae56852d779925e770d8a0 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Wed, 28 Feb 2024 13:10:27 -0500 +Subject: [PATCH] dnd: Prevent a possible segfault + +It is at least theoretically possible that gtk_entry_get_pixel_ranges +will return no ranges, and we should handle that without an +out-of-bounds access or segfault. +--- + gtk/gtkentry.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c +index 4078855c93..a71578218c 100644 +--- a/gtk/gtkentry.c ++++ b/gtk/gtkentry.c +@@ -4724,7 +4724,7 @@ gtk_entry_drag_gesture_update (GtkGestureDrag *gesture, + button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); + gtk_drag_begin_with_coordinates (widget, target_list, actions, + button, (GdkEvent*) event, +- priv->drag_start_x + ranges[0], ++ priv->drag_start_x + (n_ranges > 0 ? ranges[0] : 0), + priv->drag_start_y); + g_free (ranges); + +@@ -9931,7 +9931,7 @@ gtk_entry_drag_begin (GtkWidget *widget, + gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges); + cairo_surface_get_device_scale (surface, &sx, &sy); + cairo_surface_set_device_offset (surface, +- -(priv->drag_start_x - ranges[0]) * sx, ++ -(priv->drag_start_x - (n_ranges > 0 ? ranges[0] : 0)) * sx, + -(priv->drag_start_y) * sy); + g_free (ranges); + +-- +2.49.0 + diff --git a/SOURCES/0002-accellabel-Differentiate-keypad-better.patch b/SOURCES/0002-accellabel-Differentiate-keypad-better.patch new file mode 100644 index 0000000..1433636 --- /dev/null +++ b/SOURCES/0002-accellabel-Differentiate-keypad-better.patch @@ -0,0 +1,28 @@ +From bbf893ba560462ec60255badea9098c759598dc7 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Wed, 2 Jul 2025 10:06:38 -0400 +Subject: [PATCH 2/3] accellabel: Differentiate keypad better + +Arrange for all keypad keysyms to get a "KP" prefix, including +-*/. + +Part-of: +--- + gtk/gtkaccellabel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c +index 75b27a8726..2f6e901392 100644 +--- a/gtk/gtkaccellabel.c ++++ b/gtk/gtkaccellabel.c +@@ -884,7 +884,7 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass, + g_string_append (gstring, klass->mod_separator); + + if (accelerator_key >= GDK_KEY_KP_Space && +- accelerator_key <= GDK_KEY_KP_Equal) ++ accelerator_key <= GDK_KEY_KP_9) + { + /* Translators: "KP" means "numeric key pad". This string will + * be used in accelerators such as "Ctrl+Shift+KP 1" in menus, +-- +2.50.0 + diff --git a/SOURCES/0003-shortcutwindow-Differentiate-keypad-better.patch b/SOURCES/0003-shortcutwindow-Differentiate-keypad-better.patch new file mode 100644 index 0000000..80735fe --- /dev/null +++ b/SOURCES/0003-shortcutwindow-Differentiate-keypad-better.patch @@ -0,0 +1,49 @@ +From 246e865d4d36612ee890327b723b224250d4e9fa Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Wed, 2 Jul 2025 10:09:33 -0400 +Subject: [PATCH 3/3] shortcutwindow: Differentiate keypad better + +Arrange for keypad +-/* to show up as "KP +", and so on. + +Part-of: +--- + gtk/gtkshortcutlabel.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/gtk/gtkshortcutlabel.c b/gtk/gtkshortcutlabel.c +index bfacbd391e..e3fb13e877 100644 +--- a/gtk/gtkshortcutlabel.c ++++ b/gtk/gtkshortcutlabel.c +@@ -128,7 +128,7 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods) + { + const gchar *labels[16]; + GList *freeme = NULL; +- gchar key_label[6]; ++ gchar key_label[16]; + gchar *tmp; + gunichar ch; + gint i = 0; +@@ -181,8 +181,18 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods) + labels[i++] = C_("keyboard label", "Backslash"); + break; + default: +- memset (key_label, 0, 6); +- g_unichar_to_utf8 (g_unichar_toupper (ch), key_label); ++ memset (key_label, 0, sizeof (key_label)); ++ if (key >= GDK_KEY_KP_Space && key <= GDK_KEY_KP_9) ++ { ++ key_label[0] = 'K'; ++ key_label[1] = 'P'; ++ key_label[2] = ' '; ++ g_unichar_to_utf8 (g_unichar_toupper (ch), key_label + 3); ++ } ++ else ++ { ++ g_unichar_to_utf8 (g_unichar_toupper (ch), key_label); ++ } + labels[i++] = key_label; + break; + } +-- +2.50.0 + diff --git a/SOURCES/remove-size-allocation-critical.patch b/SOURCES/remove-size-allocation-critical.patch new file mode 100644 index 0000000..4fdb26b --- /dev/null +++ b/SOURCES/remove-size-allocation-critical.patch @@ -0,0 +1,11 @@ +diff --git a/gtk/gtkboxgadget.c b/gtk/gtkboxgadget.c +index 3cc94da1de..dba84485d8 100644 +--- a/gtk/gtkboxgadget.c ++++ b/gtk/gtkboxgadget.c +@@ -170,7 +170,6 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget, + + if G_UNLIKELY (size < 0) + { +- g_critical ("%s: assertion 'size >= 0' failed in %s", G_STRFUNC, G_OBJECT_TYPE_NAME (gtk_css_gadget_get_owner (GTK_CSS_GADGET (gadget)))); + return; + } diff --git a/SPECS/gtk3.spec b/SPECS/gtk3.spec index 7674906..f1b653f 100644 --- a/SPECS/gtk3.spec +++ b/SPECS/gtk3.spec @@ -19,7 +19,7 @@ Name: gtk3 Version: 3.24.31 -Release: 5%{?dist} +Release: 8%{?dist} Summary: GTK+ graphical user interface library License: LGPLv2+ @@ -39,6 +39,14 @@ Patch3: gtk3-3.24.31-treeview-a11y-leak-fix.patch Patch4: 0001-theme-Reduce-the-height-of-titlebars.patch # https://issues.redhat.com/browse/RHEL-46993 Patch5: 0001-Stop-looking-for-modules-in-cwd.patch +# https://issues.redhat.com/browse/RHEL-22853 +Patch6: 0001-dnd-Prevent-a-possible-segfault.patch +# https://issues.redhat.com/browse/RHEL-4130 +Patch7: remove-size-allocation-critical.patch +# https://issues.redhat.com/browse/RHEL-4098 +Patch8: 0001-Differentiate-keypad-keysyms-in-accelerators.patch +Patch9: 0002-accellabel-Differentiate-keypad-better.patch +Patch10: 0003-shortcutwindow-Differentiate-keypad-better.patch BuildRequires: pkgconfig(atk) >= %{atk_version} BuildRequires: pkgconfig(atk-bridge-2.0) @@ -306,6 +314,18 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache &>/dev/null || : %{_datadir}/installed-tests/ %changelog +* Tue Jul 2 2025 Matthias Clasen - 3.24.31-8 +- Resolves: RHEL-4098 + +* Tue Jun 10 2025 Matthias Clasen - 3.24.31-7 +- Dummy commit to get ci to rerun +- Related: RHEL-4098 + +* Mon May 12 2025 Matthias Clasen - 3.24.31-6 +- Resolves: RHEL-4130 +- Resolves: RHEL-22853 +- Resolves: RHEL-4098 + * Wed Jul 10 2024 Matthias Clasen - 3.24.31-5 - Stop looking for modules in cwd (CVE-2024-6655) - Resolves: RHEL-46993