From 81b82487d58b19246232434ae6fcbc694fb46c3c 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 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())); } }