[FindMyMouse] Add setting for excluded apps (#16308)

* refactor find_app_name_in_path

* Add a setting for excluded apps

* Restore game_mode.h
This commit is contained in:
Jaime Bernardo
2022-02-14 18:22:05 +00:00
committed by GitHub
parent 10a5629fe8
commit 05728a6dc2
11 changed files with 131 additions and 31 deletions

View File

@@ -5,6 +5,7 @@
#include <common/display/dpi_aware.h>
#include <common/utils/process_path.h>
#include <common/utils/window.h>
#include <common/utils/excluded_apps.h>
#include <array>
#include <complex>
@@ -20,20 +21,6 @@ namespace NonLocalizable
const wchar_t SplashClassName[] = L"MsoSplash";
}
bool find_app_name_in_path(const std::wstring& where, const std::vector<std::wstring>& what)
{
for (const auto& row : what)
{
const auto pos = where.rfind(row);
const auto last_slash = where.rfind('\\');
//Check that row occurs in where, and its last occurrence contains in itself the first character after the last backslash.
if (pos != std::wstring::npos && pos <= last_slash + 1 && pos + row.length() > last_slash)
{
return true;
}
}
return false;
}
namespace
{
bool IsZonableByProcessPath(const std::wstring& processPath, const std::vector<std::wstring>& excludedApps)