From b5450d4c4e2962eb6806f4b313fba8fdc56615b675d821af3442e8821cd2d3e1 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 29 Mar 2024 20:48:44 +0000 Subject: [PATCH] Accepting request 1163561 from home:luchr:branches:X11:Utilities - Added glib.patch: Fix segfault of tint2 with new version of glib2. See https://gitlab.com/nick87720z/tint2/-/issues/4 OBS-URL: https://build.opensuse.org/request/show/1163561 OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/tint2?expand=0&rev=41 --- glib.patch | 39 +++++++++++++++++++++++++++++++++++++++ tint2.changes | 7 +++++++ tint2.spec | 3 ++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 glib.patch diff --git a/glib.patch b/glib.patch new file mode 100644 index 0000000..da657a3 --- /dev/null +++ b/glib.patch @@ -0,0 +1,39 @@ +--- a/src/main.c 2022-03-24 10:49:12.000000000 +0100 ++++ b/src/main.c 2024-03-25 23:45:33.026055654 +0100 +@@ -534,11 +534,14 @@ + } + if (e->xany.window == g_tooltip.window || !systray_enabled) + break; +- for (GSList *it = systray.list_icons; it; it = it->next) ++ GSList *copy_list = g_slist_copy(systray.list_icons); ++ for (GSList *it = copy_list; it; it = it->next) + { +- if (((TrayWindow *)it->data)->win == e->xany.window) ++ void *data = it->data; ++ if (data != NULL && ((TrayWindow *)data)->win == e->xany.window) + systray_destroy_event(it->data); + } ++ g_slist_free(copy_list); + break; + + case ClientMessage: { +--- a/src/util/uevent.c 2024-03-25 23:37:18.415070100 +0100 ++++ b/src/util/uevent.c 2024-03-25 23:47:40.832150481 +0100 +@@ -146,7 +146,8 @@ + struct uevent ev; + + if (uevent_new(&ev, buf, len)) { +- for (GSList *l = notifiers; l; l = l->next) ++ GSList *copy_list = g_slist_copy(notifiers); ++ for (GSList *l = copy_list; l; l = l->next) + { + struct uevent_notify *nb = l->data; + +@@ -157,6 +158,7 @@ + + nb->cb(&ev, nb->userdata); + } ++ g_slist_free(copy_list); + uevent_destroy (&ev); + } + } diff --git a/tint2.changes b/tint2.changes index b0153d7..243c826 100644 --- a/tint2.changes +++ b/tint2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 29 17:09:32 UTC 2024 - Christian Ludwig + +- Added glib.patch: + Fix segfault of tint2 with new version of glib2. + See https://gitlab.com/nick87720z/tint2/-/issues/4 + ------------------------------------------------------------------- Fri Feb 23 08:44:18 UTC 2024 - Andrea Manzini diff --git a/tint2.spec b/tint2.spec index dc8ff50..7b1259e 100644 --- a/tint2.spec +++ b/tint2.spec @@ -25,6 +25,7 @@ Group: System/X11/Utilities URL: https://gitlab.com/nick87720z/tint2 Source0: https://gitlab.com/nick87720z/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2 Source1: tint2conf.1 +Patch0: glib.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc-c++ @@ -52,7 +53,7 @@ specifically made for Openbox3 but should also work with other window managers. %lang_package %prep -%autosetup -n %{name}-v%{version} +%autosetup -p1 -n %{name}-v%{version} %build %cmake -DCMAKE_INSTALL_DOCDIR=%{_defaultdocdir}/%{name}