Update to 3.92.0

This commit is contained in:
David King 2023-05-02 12:24:57 +01:00
parent a819aa093a
commit 64354a06c7
6 changed files with 7 additions and 399 deletions

View File

@ -1,248 +0,0 @@
From 5db548c4368459eb71da8f2a923c8830f5e0bcba Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <awilliam@redhat.com>
---
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 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="AdwMessageDialog" id="zenity_scale_dialog">
- <property name="title" translatable="yes">Adjust the scale value</property>
+ <property name="heading" translatable="yes">Adjust the scale value</property>
<property name="default_width">300</property>
<property name="default_height">100</property>
<property name="extra-child">zenity_scale_box</property>
@@ -42,7 +42,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_text_dialog">
- <property name="title" translatable="yes">Text View</property>
+ <property name="heading" translatable="yes">Text View</property>
<property name="default_width">300</property>
<property name="default_height">200</property>
<property name="resizable">true</property>
@@ -79,7 +79,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_calendar_dialog">
- <property name="title" translatable="yes">Calendar selection</property>
+ <property name="heading" translatable="yes">Calendar selection</property>
<property name="extra-child">zenity_calendar_box</property>
<responses>
<response id="cancel" translatable="yes">_Cancel</response>
@@ -129,7 +129,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_entry_dialog">
- <property name="title" translatable="yes">Add a new entry</property>
+ <property name="heading" translatable="yes">Add a new entry</property>
<property name="extra-child">zenity_entry_box</property>
<responses>
<response id="cancel" translatable="yes">_Cancel</response>
@@ -167,7 +167,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_error_dialog">
- <property name="title" translatable="yes">Error</property>
+ <property name="heading" translatable="yes">Error</property>
<property name="extra-child">zenity_error_box</property>
<responses>
<response id="ok" translatable="yes">_OK</response>
@@ -266,7 +266,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_info_dialog">
- <property name="title" translatable="yes">Information</property>
+ <property name="heading" translatable="yes">Information</property>
<property name="extra-child">zenity_info_box</property>
<responses>
<response id="ok" translatable="yes">_OK</response>
@@ -302,7 +302,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_progress_dialog">
- <property name="title" translatable="yes">Progress</property>
+ <property name="heading" translatable="yes">Progress</property>
<property name="extra-child">zenity_progress_box</property>
</object>
<object class="GtkBox" id="zenity_progress_box">
@@ -336,7 +336,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_question_dialog">
- <property name="title" translatable="yes">Question</property>
+ <property name="heading" translatable="yes">Question</property>
<property name="extra-child">zenity_question_box</property>
<responses>
<response id="no" translatable="yes">_No</response>
@@ -372,7 +372,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_tree_dialog">
- <property name="title" translatable="yes">Select items from the list</property>
+ <property name="heading" translatable="yes">Select items from the list</property>
<property name="default_width">480</property>
<property name="default_height">320</property>
<property name="extra-child">zenity_tree_box</property>
@@ -412,7 +412,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_warning_dialog">
- <property name="title" translatable="yes">Warning</property>
+ <property name="heading" translatable="yes">Warning</property>
<property name="resizable">false</property>
<property name="extra-child">zenity_warning_box</property>
<responses>
@@ -449,7 +449,7 @@
</child>
</object>
<object class="AdwMessageDialog" id="zenity_password_dialog">
- <property name="title" translatable="yes">Warning</property>
+ <property name="heading" translatable="yes">Warning</property>
<property name="resizable">false</property>
<property name="extra-child">zenity_password_box</property>
<responses>
--
2.40.0

View File

@ -1,71 +0,0 @@
From debaf6de1bfcd71d403e252caa639c52d2cba6e3 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 20 Apr 2023 09:38:28 -0700
Subject: [PATCH] progress: don't update responses that aren't there
zenity_progress_handle_stdin always tries to update these
responses when progress seems to be done, but sometimes the
responses aren't present at all. The cancel response is not
present if `no_cancel` is true (that's when the CLI param
`--no-cancel` is used), and the OK response is not present if
`auto_close` is true (that's when `--auto-close` is used). We
need to only update the responses when they're present. This
solves a problem where zenity will print some errors then crash
when `--no-cancel` or `--auto-close` (or both) are used, notably
by Steam:
zenity[3319]: adw_message_dialog_set_response_enabled: assertion 'adw_message_dialog_has_response (self, response)' failed
zenity[3319]: adw_message_dialog_set_response_enabled: assertion 'adw_message_dialog_has_response (self, response)' failed
zenity[3319]: adw_message_dialog_set_response_enabled: assertion 'adw_message_dialog_has_response (self, response)' failed
steam.desktop[3319]: **
steam.desktop[3319]: Zenity:ERROR:../src/util.c:465:zenity_util_gapp_quit: assertion failed: (GTK_IS_WINDOW (window))
steam.desktop[3319]: Bail out! Zenity:ERROR:../src/util.c:465:zenity_util_gapp_quit: assertion failed: (GTK_IS_WINDOW (window))
I don't know why this causes the parent to stop being a window,
but...apparently it does. See:
https://bugzilla.redhat.com/show_bug.cgi?id=2177287
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
src/progress.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/progress.c b/src/progress.c
index cae1a6c3..507c4c58 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -249,8 +249,11 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
if (percentage == 100)
{
- adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
- adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
+ if (!auto_close)
+ {
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
+ adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
+ }
if (progress_data->autoclose)
{
@@ -271,9 +274,13 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
{
/* We assume that we are done, so stop the pulsating and de-sensitize
* the buttons */
- adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
- adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "cancel", FALSE);
- adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
+ if (!no_cancel)
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "cancel", FALSE);
+ if (!auto_close)
+ {
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
+ adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
+ }
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 1.0);
--
2.40.0

View File

@ -1,27 +0,0 @@
From 6dde25ea5bba5efb089d6a3cd6eaea4b5f738a44 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 20 Apr 2023 13:42:29 -0700
Subject: [PATCH] tree-column-view: don't steal children
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
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

View File

@ -1,33 +0,0 @@
From da9f5f240c7d1381b87dab8c789bf0bdf47a7609 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <awilliam@redhat.com>
---
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

View File

@ -1 +1 @@
SHA512 (zenity-3.91.0.tar.xz) = a3df2a1249a5dd118760d323c060045c9105631ce39a2d14b602f9c4cd155fbb75aa1d505dd2ad33984ecee1371d4a912497bca0c761769dfd886436b63ad9fb
SHA512 (zenity-3.92.0.tar.xz) = 0e28b5fa60736210ee474ee483bd98b63f17c0d815dc6050532e82bda7d82b560f5227e4882fa6c969352d9e48d19c8addf5587acac8eac8f0fc9ac185edaf76

View File

@ -1,27 +1,11 @@
Name: zenity
Version: 3.91.0
Release: 3%{?dist}
Version: 3.92.0
Release: 1%{?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.91/%{name}-%{version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=2177287
# https://gitlab.gnome.org/GNOME/zenity/-/merge_requests/25
# 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
Source: https://download.gnome.org/sources/%{name}/3.92/%{name}-%{version}.tar.xz
BuildRequires: pkgconfig(libadwaita-1) >= 1.2
BuildRequires: /usr/bin/help2man
@ -70,6 +54,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Zenity.desk
%changelog
* Tue May 02 2023 David King <amigadave@amigadave.com> - 3.92.0-1
- Update to 3.92.0
* Thu Apr 20 2023 Adam Williamson <awilliam@redhat.com> - 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