From 91ffe5ffdaeac4a0a121e826a554e1c99950ea99 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Mon, 29 Nov 2021 14:20:00 -0600 Subject: [PATCH] fix: gtk_native_dialog_run() calls show() internally 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 06af5030a1c25..26b59f935acaa 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())); } }