[RAPPS] Load icons on background thread (#6881)

- Load icons on background thread to massively reduce loading time.

- Use SM_CXICON sized icons consistently instead of hardcoding 32 in some places.
This commit is contained in:
Whindmar Saksit 2024-06-13 02:20:41 +02:00 committed by GitHub
parent 4321c975c7
commit d73a838245
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 158 additions and 51 deletions

View file

@ -459,6 +459,14 @@ CMainWindow::ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lPa
}
break;
case WM_SETTINGCHANGE:
if (wParam == SPI_SETNONCLIENTMETRICS || wParam == SPI_SETICONMETRICS)
{
DestroyIcon(g_hDefaultPackageIcon);
g_hDefaultPackageIcon = NULL; // Trigger imagelist recreation on next load
}
break;
case WM_TIMER:
if (wParam == SEARCH_TIMER_ID)
{
@ -598,6 +606,7 @@ CMainWindow::AddApplicationsToView(CAtlList<CAppInfo *> &List)
m_ApplicationView->AddApplication(Info, bSelected);
}
}
m_ApplicationView->AddApplication(NULL, FALSE); // Tell the list we are done
}
VOID
@ -605,6 +614,13 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL
{
bUpdating = TRUE;
if (HCURSOR hCursor = LoadCursor(NULL, IDC_APPSTARTING))
{
// The database (.ini files) is parsed on the UI thread, let the user know we are busy
SetCursor(hCursor);
PostMessage(WM_SETCURSOR, (WPARAM)m_hWnd, MAKELONG(HTCLIENT, WM_MOUSEMOVE));
}
if (bCheckAvailable)
CheckAvailable();