From fdb82f5f2eff7fd703468e1963181d9dbe2527a2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 10 2020 09:50:35 +0000 Subject: import gtk3-3.22.30-6.el7 --- diff --git a/SOURCES/0001-gdkseatdefault-Unref-removed-slave-devices.patch b/SOURCES/0001-gdkseatdefault-Unref-removed-slave-devices.patch new file mode 100644 index 0000000..9fbf2b2 --- /dev/null +++ b/SOURCES/0001-gdkseatdefault-Unref-removed-slave-devices.patch @@ -0,0 +1,91 @@ +From 4cef9f34713d20d7d87c4485a789816325ddb80a Mon Sep 17 00:00:00 2001 +From: Sebastian Keller +Date: Mon, 27 Jan 2020 00:59:56 +0100 +Subject: [PATCH 1/2] gdkseatdefault: Unref removed slave devices + +Adding a slave device adds a ref, but removing it does not unref it. + +https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359 +--- + gdk/gdkseatdefault.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c +index a83901a692..98ea6335fa 100644 +--- a/gdk/gdkseatdefault.c ++++ b/gdk/gdkseatdefault.c +@@ -369,69 +369,71 @@ gdk_seat_default_add_slave (GdkSeatDefault *seat, + capability, gdk_device_get_name (device)); + return; + } + + priv->capabilities |= capability; + + gdk_seat_device_added (GDK_SEAT (seat), device); + } + + void + gdk_seat_default_remove_slave (GdkSeatDefault *seat, + GdkDevice *device) + { + GdkSeatDefaultPrivate *priv; + GList *l; + + g_return_if_fail (GDK_IS_SEAT_DEFAULT (seat)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + priv = gdk_seat_default_get_instance_private (seat); + + if (g_list_find (priv->slave_pointers, device)) + { + priv->slave_pointers = g_list_remove (priv->slave_pointers, device); + + priv->capabilities &= ~(GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH); + for (l = priv->slave_pointers; l; l = l->next) + priv->capabilities |= device_get_capability (GDK_DEVICE (l->data)); + + gdk_seat_device_removed (GDK_SEAT (seat), device); ++ g_object_unref (device); + } + else if (g_list_find (priv->slave_keyboards, device)) + { + priv->slave_keyboards = g_list_remove (priv->slave_keyboards, device); + + if (priv->slave_keyboards == NULL) + priv->capabilities &= ~GDK_SEAT_CAPABILITY_KEYBOARD; + + gdk_seat_device_removed (GDK_SEAT (seat), device); ++ g_object_unref (device); + } + } + + void + gdk_seat_default_add_tool (GdkSeatDefault *seat, + GdkDeviceTool *tool) + { + GdkSeatDefaultPrivate *priv; + + g_return_if_fail (GDK_IS_SEAT_DEFAULT (seat)); + g_return_if_fail (tool != NULL); + + priv = gdk_seat_default_get_instance_private (seat); + + if (!priv->tools) + priv->tools = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); + + g_ptr_array_add (priv->tools, g_object_ref (tool)); + g_signal_emit_by_name (seat, "tool-added", tool); + } + + void + gdk_seat_default_remove_tool (GdkSeatDefault *seat, + GdkDeviceTool *tool) + { + GdkSeatDefaultPrivate *priv; + + g_return_if_fail (GDK_IS_SEAT_DEFAULT (seat)); + g_return_if_fail (tool != NULL); + +-- +2.25.1 + diff --git a/SOURCES/0002-gdk-x11-Properly-unref-removed-device-in-XI2-device-.patch b/SOURCES/0002-gdk-x11-Properly-unref-removed-device-in-XI2-device-.patch new file mode 100644 index 0000000..b450bed --- /dev/null +++ b/SOURCES/0002-gdk-x11-Properly-unref-removed-device-in-XI2-device-.patch @@ -0,0 +1,97 @@ +From 9ce66b9d059e3552ca6feea171aa8541fc1a5cb3 Mon Sep 17 00:00:00 2001 +From: Sebastian Keller +Date: Mon, 27 Jan 2020 01:02:29 +0100 +Subject: [PATCH 2/2] gdk/x11: Properly unref removed device in XI2 device + manager + +When a device is added, there are two references to it by the device +manager, the initial one and the one used for the id_table. Removing a +device only removed the reference added by the id_table resulting in the +GdkDevice being leaked. + +https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359 +--- + gdk/x11/gdkdevicemanager-xi2.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c +index 135a0512aa..00e64d2a84 100644 +--- a/gdk/x11/gdkdevicemanager-xi2.c ++++ b/gdk/x11/gdkdevicemanager-xi2.c +@@ -616,68 +616,68 @@ add_device (GdkX11DeviceManagerXI2 *device_manager, + + return device; + } + + static void + detach_from_seat (GdkDevice *device) + { + GdkSeat *seat = gdk_device_get_seat (device); + + if (!seat) + return; + + if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER) + gdk_display_remove_seat (gdk_device_get_display (device), seat); + else if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE) + gdk_seat_default_remove_slave (GDK_SEAT_DEFAULT (seat), device); + } + + static void + remove_device (GdkX11DeviceManagerXI2 *device_manager, + gint device_id) + { + GdkDevice *device; + + device = g_hash_table_lookup (device_manager->id_table, + GINT_TO_POINTER (device_id)); + + if (device) + { + detach_from_seat (device); +- device_manager->devices = g_list_remove (device_manager->devices, device); +- +- g_signal_emit_by_name (device_manager, "device-removed", device); +- +- g_object_run_dispose (G_OBJECT (device)); + + g_hash_table_remove (device_manager->id_table, + GINT_TO_POINTER (device_id)); ++ ++ device_manager->devices = g_list_remove (device_manager->devices, device); ++ g_signal_emit_by_name (device_manager, "device-removed", device); ++ g_object_run_dispose (G_OBJECT (device)); ++ g_object_unref (device); + } + } + + static void + relate_masters (gpointer key, + gpointer value, + gpointer user_data) + { + GdkX11DeviceManagerXI2 *device_manager; + GdkDevice *device, *relative; + + device_manager = user_data; + device = g_hash_table_lookup (device_manager->id_table, key); + relative = g_hash_table_lookup (device_manager->id_table, value); + + _gdk_device_set_associated_device (device, relative); + _gdk_device_set_associated_device (relative, device); + ensure_seat_for_device_pair (device_manager, device, relative); + } + + static void + relate_slaves (gpointer key, + gpointer value, + gpointer user_data) + { + GdkX11DeviceManagerXI2 *device_manager; + GdkDevice *slave, *master; + GdkSeat *seat; + + device_manager = user_data; +-- +2.25.1 + diff --git a/SPECS/gtk3.spec b/SPECS/gtk3.spec index 718157f..d8e2241 100644 --- a/SPECS/gtk3.spec +++ b/SPECS/gtk3.spec @@ -21,7 +21,7 @@ Name: gtk3 Version: 3.22.30 -Release: 5%{?dist} +Release: 6%{?dist} Summary: GTK+ graphical user interface library License: LGPLv2+ @@ -45,6 +45,10 @@ Patch21: 0001-gdk-x11-Clamp-window-size-both-when-creating-and-res.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1660642 Patch22: 0001-gtk-icon-theme-Handle-lack-of-SVG-loader-gracefully.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1717000 +Patch23: 0001-gdkseatdefault-Unref-removed-slave-devices.patch +Patch24: 0002-gdk-x11-Properly-unref-removed-device-in-XI2-device-.patch + BuildRequires: pkgconfig(atk) >= %{atk_version} BuildRequires: pkgconfig(atk-bridge-2.0) BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} @@ -181,6 +185,8 @@ the functionality of the installed %{name} package. %patch20 -p1 %patch21 -p1 %patch22 -p1 +%patch23 -p1 +%patch24 -p1 cp %{SOURCE1} po/ @@ -371,6 +377,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/installed-tests %changelog +* Fri Oct 09 2020 Ray Strode - 3.22.30-6 +- Fix leak on VT switch + Resolves: #1882574 + * Wed Aug 07 2019 Jonas Ã…dahl - 3.22.30-5 - Handle lack of SVG loader gracefully - Resolves: #1660642