From d7060025e01b4ffe2c01bad8617075b2f32bd1a9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 17 Jan 2021 10:55:53 -0500 Subject: [PATCH 1/2] inspector: Avoid a critical Avoid a critical when closing the inspector with the recorder page open. --- gtk/inspector/recorder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index 5b6452f340..c8042ca580 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -404,6 +404,9 @@ recordings_list_row_selected (GtkListBox *box, { GtkInspectorRecording *recording; + if (recorder->recordings == NULL) + return; + if (row) recording = g_list_model_get_item (recorder->recordings, gtk_list_box_row_get_index (row)); else From 5aa03bcb0d6f590deeda5a1df283adba6ac028dc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 17 Jan 2021 11:39:36 -0500 Subject: [PATCH 2/2] aboutdialog: Fix initial focus When GtkAboutDialog was changed to derive from GtkWindow, it lost the initial focus handling that GtkDialog has. Reinstate some of it. Fixes: #3437 --- gtk/gtkaboutdialog.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 4cdee36575..6e806856b2 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -315,6 +315,17 @@ stack_visible_child_notify (GtkStack *stack, return FALSE; } +static void +gtk_about_dialog_map (GtkWidget *widget) +{ + GtkAboutDialog *about = GTK_ABOUT_DIALOG (widget); + + if (gtk_widget_get_visible (about->stack_switcher)) + gtk_widget_grab_focus (gtk_widget_get_first_child (about->stack_switcher)); + + GTK_WIDGET_CLASS (gtk_about_dialog_parent_class)->map (widget); +} + static void gtk_about_dialog_class_init (GtkAboutDialogClass *klass) { @@ -329,6 +340,8 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass) object_class->finalize = gtk_about_dialog_finalize; + widget_class->map = gtk_about_dialog_map; + klass->activate_link = gtk_about_dialog_activate_link; /**