Skip to content

Commit 32ad90f

Browse files
nnyjclaude
andauthored
Fix search auto-selecting wrong item before programs finish loading (#2451)
fix: defer auto-select until programs loaded to prevent wrong search result selection When search results refresh mid-collection, OnRefresh auto-selects the first result item. If programs haven't loaded yet, Settings category appears first and gets selected. If user hits Enter in that window, wrong item launches. Skip auto-select when search is still in progress and no programs have been found yet. Next refresh after programs load will select correctly. Fixes #456 Fixes #1982 Fixes #4 > 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent e2758ec commit 32ad90f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Src/StartMenu/StartMenuDLL/MenuContainer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6366,7 +6366,10 @@ LRESULT CMenuContainer::OnRefresh( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
63666366
}
63676367
}
63686368
else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY)
6369-
hotItem=m_OriginalCount+1;
6369+
{
6370+
if (!bSearching || !s_SearchResults.programs.empty())
6371+
hotItem=m_OriginalCount+1;
6372+
}
63706373
}
63716374
else
63726375
hotItem=-1;

0 commit comments

Comments
 (0)