diff --git a/include/SKIF.h b/include/SKIF.h index 35010b55..68fc3a1e 100644 --- a/include/SKIF.h +++ b/include/SKIF.h @@ -46,6 +46,7 @@ const UINT_PTR IDT_REFRESH_TOOLTIP = 1341; const UINT_PTR IDT_REFRESH_UPDATER = 1342; const UINT_PTR IDT_REFRESH_NOTIFY = 1343; const UINT_PTR IDT_REFRESH_DIR_ROOT = 1344; // Used by the directory watch for the root folder +//const UINT_PTR IDT_REFRESH_STEAM_LIB = 1983-1999; // Used by the directory watch for Steam libraries // Desktop notification types constexpr UINT SKIF_NTOAST_UPDATE = 0; // Appears always diff --git a/src/tabs/library.cpp b/src/tabs/library.cpp index f99fcd6f..da8d4541 100644 --- a/src/tabs/library.cpp +++ b/src/tabs/library.cpp @@ -67,6 +67,7 @@ bool tryingToLoadCover = false; std::atomic gameCoverLoading = false; std::atomic modDownloading = false; std::atomic modInstalling = false; +std::atomic gameWorkerRunning = false; std::atomic modAppId = 0; static bool clickedGameLaunch, @@ -1435,8 +1436,8 @@ SKIF_UI_Tab_DrawLibrary (void) { // Temporarily disabled since this gets triggered on game launch/shutdown as well... // And generally also breaks SKIF's library view on occasion - //if (SKIF_Steam_isLibrariesSignaled ()) - // RepopulateGames = true; + if (_registry.bLibrarySteam && SKIF_Steam_isLibrariesSignaled ()) + RepopulateGames = true; if (_registry.bLibraryEpic && SKIF_Epic_ManifestWatch.isSignaled (SKIF_Epic_AppDataPath, true)) RepopulateGames = true; @@ -1454,9 +1455,11 @@ SKIF_UI_Tab_DrawLibrary (void) RepopulateGames = true; } - if (RepopulateGames) + // We cannot manipulate the apps array while the game worker thread is running + if (RepopulateGames && ! gameWorkerRunning.load()) { RepopulateGames = false; + gameWorkerRunning.store(true); // Clear cached lists apps.clear (); @@ -1479,7 +1482,7 @@ SKIF_UI_Tab_DrawLibrary (void) //InterlockedExchange (&icon_thread, 1); PLOG_INFO << "Populating library list..."; - + apps = SKIF_Steam_GetInstalledAppIDs (); // Refresh the current Steam user @@ -1580,6 +1583,16 @@ SKIF_UI_Tab_DrawLibrary (void) continue; } + /* + if (app.second.launch_configs.size() == 0) + { + PLOG_DEBUG << "App ID " << app.second.id << " (" << app.second.store_utf8 << ") has no launch config; ignoring!"; + + app.second.id = 0; + continue; + } + */ + std::string original_name = app.first; // Some games use weird Unicode character combos that ImGui can't handle, @@ -1737,6 +1750,7 @@ SKIF_UI_Tab_DrawLibrary (void) PLOG_INFO << "Finished streaming game icons asynchronously..."; //InterlockedExchange (&icon_thread, 0); + gameWorkerRunning.store(false); // Force a refresh when the game icons have finished being streamed PostMessage (SKIF_Notify_hWnd, WM_SKIF_ICON, 0x0, 0x0); diff --git a/src/utility/utility.cpp b/src/utility/utility.cpp index 64e726a9..b438a127 100644 --- a/src/utility/utility.cpp +++ b/src/utility/utility.cpp @@ -817,7 +817,7 @@ SKIF_Util_SaveExtractExeIcon (std::wstring exePath, std::wstring targetPath) { bool ret = PathFileExists (targetPath.c_str()); - if (! ret) + if (! ret && PathFileExists (exePath.c_str())) { std::filesystem::path target = targetPath;