[BROWSEUI] Fix CompareIDs lParam passed to inner folder (#8161)

CORE-20250
This commit is contained in:
Whindmar Saksit
2025-06-24 15:45:43 +02:00
committed by GitHub
parent 1378f6b543
commit c25856d1c0
3 changed files with 10 additions and 9 deletions

View File

@@ -845,7 +845,7 @@ STDMETHODIMP CFindFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELL
if (iColumn == COL_RELEVANCE_INDEX)
{
// TODO: Fill once the relevance is calculated
return SHSetStrRet(&pDetails->str, "");
return SHSetStrRetEmpty(&pDetails->str);
}
ATLASSERT(iColumn == COL_NAME_INDEX);
@@ -903,8 +903,7 @@ STDMETHODIMP CFindFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PC
wColumn -= _countof(g_ColumnDefs) - 1;
break;
}
// FIXME: DefView does not like the way we sort
return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
return m_pisfInner->CompareIDs(MAKELONG(wColumn, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
}
STDMETHODIMP CFindFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)

View File

@@ -885,7 +885,8 @@ void CSearchBar::TrySetFocus(UINT Source)
{
BOOL IsOnButton = GetDlgItem(IDC_SEARCH_BUTTON) == hWndFocus;
BOOL IsOnSelfPane = hWndFocus == m_hWnd;
if (!hWndFocus || IsOnSelfPane || IsOnButton || !IsWindowChildOf(hWndFocus, m_hWnd))
SendMessageW(WM_NEXTDLGCTL, (WPARAM)GetDlgItem(IDC_SEARCH_FILENAME), TRUE);
BOOL IsInPaneChild = hWndFocus && IsWindowChildOf(hWndFocus, m_hWnd);
if ((cItems == 0 && !IsInPaneChild) || IsOnSelfPane || IsOnButton)
SendMessage(WM_NEXTDLGCTL, (WPARAM)GetDlgItem(IDC_SEARCH_FILENAME), TRUE);
}
}

View File

@@ -1365,13 +1365,14 @@ int CDefView::LV_FindItemByPidl(PCUITEMID_CHILD pidl)
}
else
{
for (i = 0; i < cItems; i++)
#if DBG
for (i = 0; pidl && i < cItems; i++)
{
//FIXME: ILIsEqual needs absolute pidls!
currentpidl = _PidlByItem(i);
if (ILIsEqual(pidl, currentpidl))
return i;
if (currentpidl && currentpidl->mkid.cb == pidl->mkid.cb && !memcmp(currentpidl, pidl, pidl->mkid.cb))
DbgPrint("Matched item #%d, broken CompareIDs?\n", i);
}
#endif
break;
}
}