From 5e36eed062578b6f09238397f0bd7e75dfb8338d Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:30:14 +0900 Subject: [PATCH] fix: gtk_native_dialog_run() calls show() internally (#32080) 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. Co-authored-by: Tristan Partin --- 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 c5330572cd819..a3881b01fe305 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())); } }