From c0a92868ce653cfdc4622d58219cb573f1c2b7d3 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 7 Sep 2023 21:50:36 +0900 Subject: [PATCH] Fix an issue where clicking the Left/Right Shell Menu menu item would sometimes not show the shell menu --- Src/Common/ShellContextMenu.cpp | 6 +----- Src/DirActions.h | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Src/Common/ShellContextMenu.cpp b/Src/Common/ShellContextMenu.cpp index bf1ee907d..f822d6ba5 100644 --- a/Src/Common/ShellContextMenu.cpp +++ b/Src/Common/ShellContextMenu.cpp @@ -126,7 +126,7 @@ bool CShellContextMenu::QueryShellContextMenu() String currentDir = file.path; - if (parentDir.empty()) // first iteration, initialize parentDir and pCurrFolder + if (currentDir != parentDir) { parentDir = currentDir; @@ -150,10 +150,6 @@ bool CShellContextMenu::QueryShellContextMenu() return false; } } - else if (currentDir != parentDir) // check whether file belongs to the same parentDir, break otherwise - { - return false; - } LPITEMIDLIST pidl; if (FAILED(/*hr = */pCurrFolder->ParseDisplayName(nullptr, diff --git a/Src/DirActions.h b/Src/DirActions.h index 8b1837780..4ebb75578 100644 --- a/Src/DirActions.h +++ b/Src/DirActions.h @@ -711,7 +711,8 @@ void ApplyFolderNameAndFileName(const InputIterator& begin, const InputIterator& for (InputIterator it = begin; it != end; ++it) { const DIFFITEM& di = *it; - if (di.diffcode.diffcode == 0) // Invalid value, this must be special item + if (di.diffcode.diffcode == 0 /* Invalid value, this must be special item */ || + !di.diffcode.exists(index)) continue; String filename = di.diffFileInfo[index].filename; String currentDir = di.getFilepath(index, ctxt.GetNormalizedPath(index)); -- 2.11.0