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.
This commit is contained in:
Tristan Partin 2021-12-01 22:19:36 -06:00 committed by GitHub
parent cce427dc46
commit eabfd6c1b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,9 +412,8 @@ void FileChooserDialog::OnUpdatePreview(GtkFileChooser* chooser) {
} // namespace } // namespace
void ShowFileDialog(const FileChooserDialog& dialog) { void ShowFileDialog(const FileChooserDialog& dialog) {
if (*supports_gtk_file_chooser_native) { // gtk_native_dialog_run() will call gtk_native_dialog_show() for us.
dl_gtk_native_dialog_show(static_cast<void*>(dialog.dialog())); if (!*supports_gtk_file_chooser_native) {
} else {
gtk_widget_show_all(GTK_WIDGET(dialog.dialog())); gtk_widget_show_all(GTK_WIDGET(dialog.dialog()));
} }
} }