Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workspaces] Fix snapping Discord #34602

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading