Skip to content

Commit

Permalink
[Workspaces] Fix snapping Discord (#34602)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphimaZykova authored Sep 5, 2024
1 parent afc469c commit 43654a3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/modules/Workspaces/WorkspacesLib/AppUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,23 @@ namespace Utils
}
}

// try by name if path not found
// apps list could contain a different path from that one we get from the process (for electron)
std::wstring exeName = std::filesystem::path(appPath).stem();
std::wstring exeNameUpper(exeName);
std::transform(exeNameUpper.begin(), exeNameUpper.end(), exeNameUpper.begin(), towupper);

for (const auto& appData : apps)
{
std::wstring appNameUpper(appData.name);
std::transform(appNameUpper.begin(), appNameUpper.end(), appNameUpper.begin(), towupper);

if (appNameUpper == exeNameUpper)
{
return appData;
}
}

return AppData{
.installPath = appPath
};
Expand Down

0 comments on commit 43654a3

Please sign in to comment.