summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-12 09:57:35 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-12 09:57:35 +0200
commit6b9f4418bb3802992fbf41e52c032d07e02974b4 (patch)
tree34bc651384968b9acecdb0fe87a99ce6c7f0752e
parenta8904b9622e642a2a9f777d513004e49fe4b6ccf (diff)
parent0a3a483ca732995e969a1559d8f14cd66b01431a (diff)
downloadredot-engine-6b9f4418bb3802992fbf41e52c032d07e02974b4.tar.gz
Merge pull request #96900 from bruvzg/fd_startup
Fix native file dialog showing on loading project in editor.
-rw-r--r--scene/gui/file_dialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 373488b0fc..1fc8586448 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -76,6 +76,7 @@ void FileDialog::popup(const Rect2i &p_rect) {
#ifdef TOOLS_ENABLED
if (is_part_of_edited_scene()) {
ConfirmationDialog::popup(p_rect);
+ return;
}
#endif
@@ -1380,7 +1381,7 @@ void FileDialog::set_use_native_dialog(bool p_native) {
#endif
// Replace the built-in dialog with the native one if it's currently visible.
- if (is_visible() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE) && (use_native_dialog || OS::get_singleton()->is_sandboxed())) {
+ if (is_inside_tree() && is_visible() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE) && (use_native_dialog || OS::get_singleton()->is_sandboxed())) {
ConfirmationDialog::set_visible(false);
_native_popup();
}