From eabfd6c1b9000f1178e4d363443e043103e9f520 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 1 Dec 2021 22:19:36 -0600 Subject: [PATCH] fix: gtk_native_dialog_run() calls show() internally (#32049) In the synchronous code path, gtk_native_dialog_run() will call gtk_native_dialog_show(). Previously this was causing an assertion to be hit at run time. --- shell/browser/ui/file_dialog_gtk.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shell/browser/ui/file_dialog_gtk.cc b/shell/browser/ui/file_dialog_gtk.cc index 06af5030a1c2..26b59f935aca 100644 --- a/shell/browser/ui/file_dialog_gtk.cc +++ b/shell/browser/ui/file_dialog_gtk.cc @@ -412,9 +412,8 @@ void FileChooserDialog::OnUpdatePreview(GtkFileChooser* chooser) { } // namespace void ShowFileDialog(const FileChooserDialog& dialog) { - if (*supports_gtk_file_chooser_native) { - dl_gtk_native_dialog_show(static_cast(dialog.dialog())); - } else { + // gtk_native_dialog_run() will call gtk_native_dialog_show() for us. + if (!*supports_gtk_file_chooser_native) { gtk_widget_show_all(GTK_WIDGET(dialog.dialog())); } }