From b14b222e9dad8e35db36757779870ce073d17d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anni=20Ryyn=C3=A4nen?= Date: Sun, 9 Jun 2024 17:54:18 +0300 Subject: [PATCH] Fix native file dialogs being shown on `set_visible(false)` --- scene/gui/file_dialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 0c146ce173a..a23ee6db717 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -99,7 +99,9 @@ void FileDialog::set_visible(bool p_visible) { #endif if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE) && (use_native_dialog || OS::get_singleton()->is_sandboxed())) { - _native_popup(); + if (p_visible) { + _native_popup(); + } } else { ConfirmationDialog::set_visible(p_visible); }