From 375f88d16128f419d21ed9e109e0da79fc6d7711 Mon Sep 17 00:00:00 2001 From: Paul Marechal Date: Sun, 14 Sep 2025 18:20:15 -0400 Subject: [PATCH] Fix file_dialog's root_subfolder on Windows `root_prefix` either contains an empty string or the current root including the drive letter. This means that the previous logic would never ever match since `dir_access->get_current_dir(false)` explicitly excludes the drive letter. This change removes this boolean parameter so we compare paths in a way that can match. I've had a look at the implementations for other platforms for `DirAccess::get_current_dir(bool include_drive)` and outside Windows none seem to consider the `include_drive` parameter which makes me believe that this change won't break other platforms. --- scene/gui/file_dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 8184b9300b4..a07645e2226 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -1448,7 +1448,7 @@ void FileDialog::_change_dir(const String &p_new_dir) { } else { String old_dir = dir_access->get_current_dir(); dir_access->change_dir(p_new_dir); - if (!dir_access->get_current_dir(false).begins_with(root_prefix)) { + if (!dir_access->get_current_dir().begins_with(root_prefix)) { dir_access->change_dir(old_dir); return; }