From 283bc177a4eaa8610c7a4f70e35bc8c5612068db Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Tue, 5 Aug 2025 00:11:33 +0200 Subject: [PATCH] Fix #143939: Fix Win32 External Ops, Open Folder/CMD for Files File Browser list, Context Menu, External. On Win32 for items that are not folders we need to use the list root for "open folder" and for "command prompt here". Pull Request: https://projects.blender.org/blender/blender/pulls/143964 --- source/blender/editors/space_file/file_ops.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/blender/editors/space_file/file_ops.cc b/source/blender/editors/space_file/file_ops.cc index 0c72ccd717d..c94dfa8ed4c 100644 --- a/source/blender/editors/space_file/file_ops.cc +++ b/source/blender/editors/space_file/file_ops.cc @@ -1865,6 +1865,17 @@ static wmOperatorStatus file_external_operation_exec(bContext *C, wmOperator *op #ifdef WIN32 const FileExternalOperation operation = (FileExternalOperation)RNA_enum_get(op->ptr, "operation"); + + if (!(fileentry->typeflag & FILE_TYPE_DIR) && + ELEM(operation, FILE_EXTERNAL_OPERATION_FOLDER_OPEN, FILE_EXTERNAL_OPERATION_FOLDER_CMD)) + { + /* Not a folder path, so for these operations use the root. */ + const char *root = filelist_dir(sfile->files); + if (BLI_file_external_operation_execute(root, operation)) { + WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT); + return OPERATOR_FINISHED; + } + } if (BLI_file_external_operation_execute(filepath, operation)) { WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT); return OPERATOR_FINISHED;