Browse Source

fix: gtk_native_dialog_run() calls show() internally (#32082)

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 <[email protected]>
trop[bot] 3 years ago
parent
commit
371a61dc59
1 changed files with 2 additions and 3 deletions
  1. 2 3
      shell/browser/ui/file_dialog_gtk.cc

+ 2 - 3
shell/browser/ui/file_dialog_gtk.cc

@@ -410,9 +410,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<void*>(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()));
   }
 }