diff --git a/0001-util-remove-fatal-assert-on-exit-if-window-invalid-G.patch b/0001-util-remove-fatal-assert-on-exit-if-window-invalid-G.patch new file mode 100644 index 0000000..9888b45 --- /dev/null +++ b/0001-util-remove-fatal-assert-on-exit-if-window-invalid-G.patch @@ -0,0 +1,35 @@ +From b6d3ff07044e3e48cbaf66ed4ae0fc17e10a910e Mon Sep 17 00:00:00 2001 +From: Logan Rathbone +Date: Mon, 8 May 2023 01:16:37 -0400 +Subject: [PATCH 1/2] util: remove fatal assert on exit if window invalid + GtkWindow + +See https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/25#note_1738825 +--- + src/util.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/src/util.c b/src/util.c +index 8cfae934..85847df1 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -460,14 +460,10 @@ zenity_util_gapp_quit (GtkWindow *window, ZenityData *data) + if (data->exit_code != 0) + exit (data->exit_code); + +- if (window) +- { +- g_assert (GTK_IS_WINDOW (window)); ++ if (window && GTK_IS_WINDOW (window)) + gtk_window_destroy (window); +- } +- else { ++ else + g_application_release (g_application_get_default ()); +- } + } + + int +-- +2.40.1 + diff --git a/0002-progress-Cleanup-unnecessary-static-objects-and-remo.patch b/0002-progress-Cleanup-unnecessary-static-objects-and-remo.patch new file mode 100644 index 0000000..0c4b192 --- /dev/null +++ b/0002-progress-Cleanup-unnecessary-static-objects-and-remo.patch @@ -0,0 +1,104 @@ +From 93d4c88cea5167cc6d2bed8b85b7931399068d59 Mon Sep 17 00:00:00 2001 +From: Logan Rathbone +Date: Mon, 8 May 2023 02:22:08 -0400 +Subject: [PATCH 2/2] progress: Cleanup unnecessary static objects and remove + spurious builder unref + +--- + src/progress.c | 27 +++++++++++---------------- + 1 file changed, 11 insertions(+), 16 deletions(-) + +diff --git a/src/progress.c b/src/progress.c +index adc75745..8e6e8951 100644 +--- a/src/progress.c ++++ b/src/progress.c +@@ -40,16 +40,12 @@ + + static GtkBuilder *builder; + static ZenityData *zen_data; +-static GIOChannel *channel; + + static int pulsate_timeout = -1; + static gboolean autokill; + static gboolean no_cancel; + static gboolean auto_close; + +-gint zenity_progress_timeout (gpointer data); +-gint zenity_progress_pulsate_timeout (gpointer data); +- + static void zenity_progress_dialog_response (GtkWidget *widget, char *rstr, gpointer data); + + static gboolean +@@ -147,13 +143,13 @@ stof (const char *s) + } + + static gboolean +-zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, ++zenity_progress_handle_stdin (GIOChannel *source, GIOCondition condition, + gpointer data) + { +- static ZenityProgressData *progress_data; +- static GObject *progress_bar; +- static GObject *progress_label; +- static GtkWindow *parent; ++ ZenityProgressData *progress_data; ++ GObject *progress_bar; ++ GObject *progress_label; ++ GtkWindow *parent; + float percentage = 0.0; + GIOStatus status = G_IO_STATUS_NORMAL; + +@@ -167,12 +163,12 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, + g_autoptr(GString) string = g_string_new (NULL); + g_autoptr(GError) error = NULL; + +- while (channel->is_readable != TRUE) ++ while (source->is_readable != TRUE) + ; + do { + do { + status = g_io_channel_read_line_string ( +- channel, string, NULL, &error); ++ source, string, NULL, &error); + + while (g_main_context_pending (NULL)) { + g_main_context_iteration (NULL, FALSE); +@@ -265,7 +261,7 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, + } + } + +- } while ((g_io_channel_get_buffer_condition (channel) & G_IO_IN) == ++ } while ((g_io_channel_get_buffer_condition (source) & G_IO_IN) == + G_IO_IN && + status != G_IO_STATUS_EOF); + } +@@ -286,15 +282,13 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, + + zenity_progress_pulsate_stop (); + +- g_object_unref (builder); +- + if (progress_data->autoclose) + { + zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK); + zenity_util_gapp_quit (parent, zen_data); + } + +- g_io_channel_shutdown (channel, TRUE, NULL); ++ g_io_channel_shutdown (source, TRUE, NULL); + return FALSE; + } + return TRUE; +@@ -303,7 +297,8 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, + static void + zenity_progress_read_info (ZenityProgressData *progress_data) + { +- channel = g_io_channel_unix_new (0); ++ GIOChannel *channel = g_io_channel_unix_new (0); ++ + g_io_channel_set_encoding (channel, NULL, NULL); + g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL); + g_io_add_watch (channel, +-- +2.40.1 + diff --git a/zenity.spec b/zenity.spec index 28150f4..d40c78c 100644 --- a/zenity.spec +++ b/zenity.spec @@ -1,12 +1,19 @@ Name: zenity Version: 3.92.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Display dialog boxes from shell scripts License: LGPL-2.1-or-later URL: https://wiki.gnome.org/Projects/Zenity Source: https://download.gnome.org/sources/%{name}/3.92/%{name}-%{version}.tar.xz +# https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/25#note_1740317 +# https://bugzilla.redhat.com/show_bug.cgi?id=2177287 +# Hoping these two will finally fix the zenity crashes people are +# seeing when launch Steam etc. Backports from upstream master +Patch0: 0001-util-remove-fatal-assert-on-exit-if-window-invalid-G.patch +Patch1: 0002-progress-Cleanup-unnecessary-static-objects-and-remo.patch + BuildRequires: pkgconfig(libadwaita-1) >= 1.2 BuildRequires: /usr/bin/help2man BuildRequires: desktop-file-utils @@ -54,6 +61,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Zenity.desk %changelog +* Mon May 08 2023 Adam Williamson - 3.92.0-2 +- Backport two patches from upstream to hopefully really fix crashes (#2177287) + * Tue May 02 2023 David King - 3.92.0-1 - Update to 3.92.0