From 4787295ea3719247151c58437f9041d89419f449a28b2bce4f1bec340f4c8311 Mon Sep 17 00:00:00 2001 From: Manfred Hollstein Date: Sun, 5 Nov 2023 18:25:09 +0000 Subject: [PATCH] Accepting request 1123430 from home:tux93:branches:X11:xfce - Add gxo-282.patch * backport fix for crash on window close (gxo#apps/xfce4-terminal#282) OBS-URL: https://build.opensuse.org/request/show/1123430 OBS-URL: https://build.opensuse.org/package/show/X11:xfce/xfce4-terminal?expand=0&rev=64 --- gxo-282.patch | 50 ++++++++++++++++++++++++++++++++++++++++++ xfce4-terminal.changes | 7 ++++++ xfce4-terminal.spec | 4 +++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 gxo-282.patch diff --git a/gxo-282.patch b/gxo-282.patch new file mode 100644 index 0000000..967f5fc --- /dev/null +++ b/gxo-282.patch @@ -0,0 +1,50 @@ +From 036c903e1d6ac8eee72d920d7019c7836381fa2a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= +Date: Mon, 23 Oct 2023 19:24:09 +0200 +Subject: [PATCH] Do not reconnect accels when closing last tab + +G_IS_OBJECT and similar derived macros are not valid tests of whether an +object is still alive. They are intended to test the type of an object +assumed to be alive (although they return FALSE for a null pointer for +convenience). + +This can cause a crash on some systems when closing last tab if +/misc-always-show-tabs is TRUE. + +Fixes: 31712a009ec4db4a0731431905a169fe610286e5 +--- + terminal/terminal-screen.c | 3 +-- + terminal/terminal-window.c | 3 ++- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c +index 6fe8f1c2..52ee7549 100644 +--- a/terminal/terminal-screen.c ++++ b/terminal/terminal-screen.c +@@ -3151,8 +3151,7 @@ terminal_screen_widget_append_accels (TerminalScreen *screen, + { + terminal_return_if_fail (TERMINAL_IS_SCREEN (screen)); + +- if (G_LIKELY (G_IS_OBJECT (screen->terminal))) +- g_object_set (G_OBJECT (screen->terminal), "accel-group", accel_group, NULL); ++ g_object_set (G_OBJECT (screen->terminal), "accel-group", accel_group, NULL); + } + + +diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c +index fc830237..71767208 100644 +--- a/terminal/terminal-window.c ++++ b/terminal/terminal-window.c +@@ -2577,7 +2577,8 @@ terminal_window_do_close_tab (TerminalScreen *screen, + gtk_widget_destroy (GTK_WIDGET (screen)); + + /* reconnect the accels of the active terminal */ +- terminal_screen_widget_append_accels (window->priv->active, window->priv->accel_group); ++ if (screen != window->priv->active) ++ terminal_screen_widget_append_accels (window->priv->active, window->priv->accel_group); + } + + +-- +GitLab + diff --git a/xfce4-terminal.changes b/xfce4-terminal.changes index a383d11..0f4dca8 100644 --- a/xfce4-terminal.changes +++ b/xfce4-terminal.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Nov 5 18:12:55 UTC 2023 - Marcel Kuehlhorn + +- Add gxo-282.patch + * backport fix for crash on window close + (gxo#apps/xfce4-terminal#282) + ------------------------------------------------------------------- Sun Oct 15 07:29:34 UTC 2023 - Manfred Hollstein diff --git a/xfce4-terminal.spec b/xfce4-terminal.spec index 48870db..d473b03 100644 --- a/xfce4-terminal.spec +++ b/xfce4-terminal.spec @@ -26,6 +26,8 @@ License: GPL-2.0-or-later Group: System/X11/Terminals URL: https://docs.xfce.org/apps/terminal/start Source0: https://archive.xfce.org/src/apps/xfce4-terminal/1.1/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM: backport fix for crash on window close +Patch0: gxo-282.patch BuildRequires: intltool BuildRequires: pkgconfig BuildRequires: update-desktop-files @@ -52,7 +54,7 @@ helps to save space on the desktop. %lang_package %prep -%setup -q +%autosetup -p1 %build %if %{with git}