Skip to content

Commit a99474b

Browse files
AlapipapiSeraphimaZykovadonlaci
committed
[Workspaces] detecting right app version (microsoft#36100)
* [Workspaces] Add move functionality * spell checker * [Workspaces] Modify Arranger to move apps without launch * moved ipc helper * removed callback * use LauncherStatus in WindowArranger * wait for launching next app * launch in a separate thread and protect by mutexes * update app version in advance * changed canceling launch * increased waiting time * Fix optional parameter load from json * changed arranger waiting time * additional waiting time for Outlook * added app id * ensure ids before launch * set id in editor * minor updates * [Workspaces] Move: Get the nearest window when moving a window * [Workspaces] convert optional boolean to enum to avoid json problems * Handle case when the new Application Property "moveIfExists" does not exist * Re-implementing app-window pairing for moving feature. * spell checker * XAML formatting * Fixing bug: IPC message not arriving * spell checker * Removing app-level-setting for move app. Also fixed compiler errors due styling. * Updating editor window layout * Re-implementing window positioning UI elements * XAML formatting * Code review findings * Code cleanup * Code cleanup * Code cleanup * code cleanup * Code cleanup * Code cleanup * [Workspaces] fix detection of specific version of apps --------- Co-authored-by: Seraphima <[email protected]> Co-authored-by: donlaci <[email protected]>
1 parent 56acf0d commit a99474b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/modules/Workspaces/WorkspacesLib/AppUtils.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ namespace Utils
252252
}
253253

254254
// search in apps list
255+
std::optional<AppData> appDataPlanB{ std::nullopt };
255256
for (const auto& appData : apps)
256257
{
257258
if (!appData.installPath.empty())
@@ -274,13 +275,19 @@ namespace Utils
274275

275276
// edge case, some apps (e.g., Gitkraken) have different .exe files in the subfolders.
276277
// apps list contains only one path, so in this case app is not found
278+
// remember the match and return it in case the loop is over and there are no direct matches
277279
if (std::filesystem::path(appPath).filename() == std::filesystem::path(appData.installPath).filename())
278280
{
279-
return appData;
281+
appDataPlanB = appData;
280282
}
281283
}
282284
}
283285

286+
if (appDataPlanB.has_value())
287+
{
288+
return appDataPlanB.value();
289+
}
290+
284291
// try by name if path not found
285292
// apps list could contain a different path from that one we get from the process (for electron)
286293
std::wstring exeName = std::filesystem::path(appPath).stem();

0 commit comments

Comments
 (0)