mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-20 18:54:38 +10:00
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 Open-Shell/Open-Shell-Menu#456 Fixes Open-Shell/Open-Shell-Menu#1982 Fixes Open-Shell/Open-Shell-Menu#4 > 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6366,8 +6366,11 @@ LRESULT CMenuContainer::OnRefresh( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY)
|
else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY)
|
||||||
|
{
|
||||||
|
if (!bSearching || !s_SearchResults.programs.empty())
|
||||||
hotItem=m_OriginalCount+1;
|
hotItem=m_OriginalCount+1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
hotItem=-1;
|
hotItem=-1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user