Browse Source

Merge pull request #92943 from anniryynanen/less-file-dialogs

Fix native file dialogs being shown on `set_visible(false)`
Rémi Verschelde 1 year ago
parent
commit
7128667959
1 changed files with 3 additions and 1 deletions
  1. 3 1
      scene/gui/file_dialog.cpp

+ 3 - 1
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);
 	}