diff --git a/0001-Set-dialog-heading-not-title.patch b/0001-Set-dialog-heading-not-title.patch new file mode 100644 index 0000000..52bfa03 --- /dev/null +++ b/0001-Set-dialog-heading-not-title.patch @@ -0,0 +1,248 @@ +From 5db548c4368459eb71da8f2a923c8830f5e0bcba Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 20 Apr 2023 11:57:34 -0700 +Subject: [PATCH] Set dialog 'heading', not 'title' + +In the GTK 4 port, we made all Zenity dialogs use the libadwaita +`AdwMessageDialog` class. This dialog does not have a title bar +and does not show its title. The equivalent to title for this +class is 'heading' - everywhere we were previously setting the +title, we should set the 'heading' instead. + +Signed-off-by: Adam Williamson +--- + src/calendar.c | 2 +- + src/entry.c | 2 +- + src/forms.c | 2 +- + src/msg.c | 2 +- + src/password.c | 2 +- + src/progress.c | 2 +- + src/scale.c | 2 +- + src/text.c | 2 +- + src/tree.c | 2 +- + src/zenity.ui | 22 +++++++++++----------- + 10 files changed, 20 insertions(+), 20 deletions(-) + +diff --git a/src/calendar.c b/src/calendar.c +index f5237d1a..1eac9f3e 100644 +--- a/src/calendar.c ++++ b/src/calendar.c +@@ -60,7 +60,7 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) + G_CALLBACK(zenity_calendar_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + gtk_window_set_icon_name (GTK_WINDOW(dialog), + "x-office-calendar"); +diff --git a/src/entry.c b/src/entry.c +index bf94cd44..2632d280 100644 +--- a/src/entry.c ++++ b/src/entry.c +@@ -73,7 +73,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) + g_signal_connect (dialog, "response", G_CALLBACK(zenity_entry_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + gtk_window_set_icon_name (GTK_WINDOW(dialog), + "insert-text"); +diff --git a/src/forms.c b/src/forms.c +index 4e4a60e5..59ada04a 100644 +--- a/src/forms.c ++++ b/src/forms.c +@@ -248,7 +248,7 @@ zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data) + G_CALLBACK (zenity_forms_dialog_response), forms_data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + if (data->width > -1 || data->height > -1) { + gtk_window_set_default_size (GTK_WINDOW(dialog), +diff --git a/src/msg.c b/src/msg.c +index 87a5beb0..8ebb2e02 100644 +--- a/src/msg.c ++++ b/src/msg.c +@@ -122,7 +122,7 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data) + g_signal_connect (dialog, "response", G_CALLBACK(zenity_msg_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + if (data->ok_label) + { +diff --git a/src/password.c b/src/password.c +index 69dd6835..fc270216 100644 +--- a/src/password.c ++++ b/src/password.c +@@ -120,7 +120,7 @@ zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data) + 1, 1); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + if (data->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); +diff --git a/src/progress.c b/src/progress.c +index cae1a6c3..a33763d5 100644 +--- a/src/progress.c ++++ b/src/progress.c +@@ -340,7 +340,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) + g_signal_connect (dialog, "response", G_CALLBACK(zenity_progress_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + gtk_window_set_icon_name (GTK_WINDOW(dialog), + "appointment-soon"); +diff --git a/src/scale.c b/src/scale.c +index 7ac0f413..73ab015a 100644 +--- a/src/scale.c ++++ b/src/scale.c +@@ -73,7 +73,7 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data) + } + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + gtk_window_set_icon_name (GTK_WINDOW(dialog), + "dialog-question"); +diff --git a/src/text.c b/src/text.c +index 7c37855c..2e9f2fbd 100644 +--- a/src/text.c ++++ b/src/text.c +@@ -280,7 +280,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) + G_CALLBACK(zenity_text_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + gtk_window_set_icon_name (GTK_WINDOW(dialog), + "accessories-text-editor"); +diff --git a/src/tree.c b/src/tree.c +index b59a9198..2f970944 100644 +--- a/src/tree.c ++++ b/src/tree.c +@@ -291,7 +291,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) + g_signal_connect (dialog, "response", G_CALLBACK(zenity_tree_dialog_response), data); + + if (data->dialog_title) +- gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title); ++ adw_message_dialog_set_heading (ADW_MESSAGE_DIALOG(dialog), data->dialog_title);; + + if (data->modal) + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); +diff --git a/src/zenity.ui b/src/zenity.ui +index e4e6a5b7..5644aff0 100644 +--- a/src/zenity.ui ++++ b/src/zenity.ui +@@ -6,7 +6,7 @@ + + + +- Adjust the scale value ++ Adjust the scale value + 300 + 100 + zenity_scale_box +@@ -42,7 +42,7 @@ + + + +- Text View ++ Text View + 300 + 200 + true +@@ -79,7 +79,7 @@ + + + +- Calendar selection ++ Calendar selection + zenity_calendar_box + + _Cancel +@@ -129,7 +129,7 @@ + + + +- Add a new entry ++ Add a new entry + zenity_entry_box + + _Cancel +@@ -167,7 +167,7 @@ + + + +- Error ++ Error + zenity_error_box + + _OK +@@ -266,7 +266,7 @@ + + + +- Information ++ Information + zenity_info_box + + _OK +@@ -302,7 +302,7 @@ + + + +- Progress ++ Progress + zenity_progress_box + + +@@ -336,7 +336,7 @@ + + + +- Question ++ Question + zenity_question_box + + _No +@@ -372,7 +372,7 @@ + + + +- Select items from the list ++ Select items from the list + 480 + 320 + zenity_tree_box +@@ -412,7 +412,7 @@ + + + +- Warning ++ Warning + false + zenity_warning_box + +@@ -449,7 +449,7 @@ + + + +- Warning ++ Warning + false + zenity_password_box + +-- +2.40.0 + diff --git a/0001-tree-column-view-don-t-steal-children.patch b/0001-tree-column-view-don-t-steal-children.patch new file mode 100644 index 0000000..421b623 --- /dev/null +++ b/0001-tree-column-view-don-t-steal-children.patch @@ -0,0 +1,27 @@ +From 6dde25ea5bba5efb089d6a3cd6eaea4b5f738a44 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 20 Apr 2023 13:42:29 -0700 +Subject: [PATCH] tree-column-view: don't steal children + +Signed-off-by: Adam Williamson +--- + src/zenity-tree-column-view.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/zenity-tree-column-view.c b/src/zenity-tree-column-view.c +index 9b4b5a60..5117f954 100644 +--- a/src/zenity-tree-column-view.c ++++ b/src/zenity-tree-column-view.c +@@ -555,7 +555,8 @@ factory_bind_cb (ZenityTreeColumnView *self, + item = zenity_tree_row_get_item (row, col_index); + item_child = zenity_tree_item_get_child (item); + item_text = zenity_tree_item_get_text (item); +- gtk_list_item_set_child (list_item, item_child); ++ if (!gtk_widget_get_parent (item_child)) ++ gtk_list_item_set_child (list_item, item_child); + + gtk_widget_set_halign (item_child, GTK_ALIGN_START); + +-- +2.40.0 + diff --git a/0001-tree-fix-handling-of-multi-row-stdin-input-54.patch b/0001-tree-fix-handling-of-multi-row-stdin-input-54.patch new file mode 100644 index 0000000..76c3417 --- /dev/null +++ b/0001-tree-fix-handling-of-multi-row-stdin-input-54.patch @@ -0,0 +1,33 @@ +From da9f5f240c7d1381b87dab8c789bf0bdf47a7609 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 20 Apr 2023 13:22:19 -0700 +Subject: [PATCH] tree: fix handling of multi-row stdin input (#54) + +This was broken by the GtkColumnView port (7a80b67). As part of +the changes that just stopped any attempt to actually start a +new row here, so we just kept stuffing more and more items into +the only row item we ever create. So you just couldn't do multi- +row input via stdin. + +Signed-off-by: Adam Williamson +--- + src/tree.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/tree.c b/src/tree.c +index b59a9198..0747fcf3 100644 +--- a/src/tree.c ++++ b/src/tree.c +@@ -120,6 +120,9 @@ zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer + /* We're starting a new row */ + column_count = 0; + row_count++; ++ if (row) ++ g_list_store_append (store, row); ++ row = zenity_tree_row_new (); + } + + if (toggles && column_count == 0) +-- +2.40.0 + diff --git a/zenity.spec b/zenity.spec index c3caf07..8af958e 100644 --- a/zenity.spec +++ b/zenity.spec @@ -1,6 +1,6 @@ Name: zenity Version: 3.91.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Display dialog boxes from shell scripts License: LGPL-2.1-or-later @@ -11,6 +11,17 @@ Source: https://download.gnome.org/sources/%{name}/3.91/%{name}-%{version # Fix crash caused by trying to set responses that aren't there # when --no-cancel and/or --auto-close are used Patch0: 0001-progress-don-t-update-responses-that-aren-t-there.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2184783 +# https://gitlab.gnome.org/GNOME/zenity/-/issues/54 +# https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/26 +# https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/27 +# Set 'heading' not 'title' for AdwMessageDialog, fix parsing multiple +# tree rows from stdin +Patch1: 0001-Set-dialog-heading-not-title.patch +Patch2: 0001-tree-fix-handling-of-multi-row-stdin-input-54.patch +# https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/28 +# Fix errors shown on console when mousing over items in tree views +Patch3: 0001-tree-column-view-don-t-steal-children.patch BuildRequires: pkgconfig(libadwaita-1) >= 1.2 BuildRequires: /usr/bin/help2man @@ -59,6 +70,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Zenity.desk %changelog +* Thu Apr 20 2023 Adam Williamson - 3.91.0-3 +- Backport MRs #26 and #27 to fix bugs in tree views (#2184783) +- Backport MR #28 to fix some console error spam + * Thu Apr 20 2023 Adam Williamson - 3.91.0-2 - Backport MR #25 for crash when --no-cancel and/or --auto-close are used (#2177287)