Merge pull request #99652 from bruvzg/fd_cd_win

[Windows] Fix root and current folder in native file dialog.
This commit is contained in:
Rémi Verschelde 2024-12-02 17:20:27 +01:00
commit aab12fd273
No known key found for this signature in database
GPG key ID: C3336907360768E1
5 changed files with 23 additions and 15 deletions

View file

@ -572,10 +572,7 @@ void DisplayServerWindows::_thread_fd_monitor(void *p_ud) {
}
}
dir = dir.simplify_path();
dir = dir.replace("/", "\\");
if (!dir.is_network_share_path() && !dir.begins_with(R"(\\?\)")) {
dir = R"(\\?\)" + dir;
}
dir = dir.trim_prefix(R"(\\?\)").replace("/", "\\");
IShellItem *shellitem = nullptr;
hr = SHCreateItemFromParsingName((LPCWSTR)dir.utf16().ptr(), nullptr, IID_IShellItem, (void **)&shellitem);