mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 11:17:53 +01:00
fix placing windows of the same app in the project
This commit is contained in:
@@ -235,14 +235,14 @@ void Launch(const Project& project)
|
||||
{
|
||||
// Get the set of windows before launching the app
|
||||
std::vector<HWND> windowsBefore = WindowEnumerator::Enumerate(WindowFilter::Filter);
|
||||
std::map<Project::Application, HWND> launchedWindows{};
|
||||
std::vector<std::pair<Project::Application, HWND>> launchedWindows{};
|
||||
auto apps = Utils::Apps::GetAppsList();
|
||||
|
||||
for (const auto& app : project.apps)
|
||||
{
|
||||
if (Launch(app))
|
||||
{
|
||||
launchedWindows.insert({ app, nullptr });
|
||||
launchedWindows.push_back({ app, nullptr });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ void Launch(const Project& project)
|
||||
}
|
||||
|
||||
// set the window
|
||||
auto res = std::find_if(launchedWindows.begin(), launchedWindows.end(), [&](const std::pair<Project::Application, HWND>& val) { return val.first.name == app->name; });
|
||||
auto res = std::find_if(launchedWindows.begin(), launchedWindows.end(), [&](const std::pair<Project::Application, HWND>& val) { return val.first.name == app->name && val.second == nullptr; });
|
||||
if (res != launchedWindows.end())
|
||||
{
|
||||
res->second = window;
|
||||
|
||||
@@ -33,11 +33,6 @@ struct Project
|
||||
bool isMaximized{};
|
||||
Position position{};
|
||||
int monitor{};
|
||||
|
||||
bool operator<(const Application& rhs) const noexcept
|
||||
{
|
||||
return path < rhs.path;
|
||||
}
|
||||
};
|
||||
|
||||
struct Monitor
|
||||
|
||||
Reference in New Issue
Block a user