From 8ff9c851ce6ab14eeccc8b0fdffec6181b26ac90 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 3 Jul 2021 15:15:06 -0400 Subject: [PATCH] filechooser: Avoid a critical This was showing up when calling some filechooser api on a native filechooser, where we use a filechooser dialog behind the scenes, but it does not have focus. Fixes: #4077 --- gtk/gtkfilechooserwidget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 918206ac26..f2fe1f9257 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -5444,6 +5444,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser) goto file_entry; } else if (impl->location_entry && + current_focus && (current_focus == impl->location_entry || gtk_widget_is_ancestor (current_focus, impl->location_entry))) {