From 490d4b0b9ec5141cef79f6b484d7995117e87729 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 20 Oct 2022 21:13:46 -0400 Subject: [PATCH 1/2] inspector: Fix accessibility calls The argument list of gtk_accessible_update_property is -1-terminated, not NULL-terminated. --- gtk/inspector/prop-editor.c | 4 ++-- gtk/inspector/strv-editor.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c index df87ef3b38..caf02d1389 100644 --- a/gtk/inspector/prop-editor.c +++ b/gtk/inspector/prop-editor.c @@ -1259,13 +1259,13 @@ property_editor (GObject *object, g_strdup_printf ("%s: %s", self->name, gtk_label_get_text (GTK_LABEL (prop_edit))), - NULL); + -1); } else { gtk_accessible_update_property (GTK_ACCESSIBLE (prop_edit), GTK_ACCESSIBLE_PROPERTY_LABEL, self->name, - NULL); + -1); } return prop_edit; diff --git a/gtk/inspector/strv-editor.c b/gtk/inspector/strv-editor.c index 3230d63351..9596936a82 100644 --- a/gtk/inspector/strv-editor.c +++ b/gtk/inspector/strv-editor.c @@ -72,7 +72,7 @@ add_string (GtkInspectorStrvEditor *editor, gtk_editable_set_text (GTK_EDITABLE (entry), str); gtk_accessible_update_property (GTK_ACCESSIBLE (entry), GTK_ACCESSIBLE_PROPERTY_LABEL, _("Value"), - NULL); + -1); gtk_widget_show (entry); gtk_box_append (GTK_BOX (box), entry); g_object_set_data (G_OBJECT (box), "entry", entry); @@ -83,7 +83,7 @@ add_string (GtkInspectorStrvEditor *editor, gtk_accessible_update_property (GTK_ACCESSIBLE (button), GTK_ACCESSIBLE_PROPERTY_LABEL, g_strdup_printf (_("Remove %s"), str), - NULL); + -1); gtk_widget_show (button); gtk_box_append (GTK_BOX (box), button); g_signal_connect (button, "clicked", G_CALLBACK (remove_string), editor); @@ -116,7 +116,7 @@ gtk_inspector_strv_editor_init (GtkInspectorStrvEditor *editor) gtk_widget_set_halign (editor->button, GTK_ALIGN_END); gtk_accessible_update_property (GTK_ACCESSIBLE (editor->button), GTK_ACCESSIBLE_PROPERTY_LABEL, _("Add"), - NULL); + -1); gtk_widget_show (editor->button); g_signal_connect (editor->button, "clicked", G_CALLBACK (add_cb), editor); From 5310abbcf701ffe52687767e7baba4c5c4c6fd91 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 20 Oct 2022 21:41:18 -0400 Subject: [PATCH 2/2] filechooserentry: Fix completions Before we can drop them, lets make them work. This was broken since 4.0, I assume :( --- gtk/gtkfilechooserentry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 1d5c66c435..39f7c3dceb 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -637,7 +637,7 @@ finished_loading_cb (GtkFileSystemModel *model, completion = gtk_entry_get_completion (GTK_ENTRY (chooser_entry)); update_inline_completion (chooser_entry); - if (gtk_widget_has_focus (GTK_WIDGET (chooser_entry))) + if (gtk_widget_has_focus (GTK_WIDGET (gtk_entry_get_text_widget (GTK_ENTRY (chooser_entry))))) { gtk_entry_completion_complete (completion); gtk_entry_completion_insert_prefix (completion);