mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
[FancyZones] Update windows positions after changing the layout fix (#18805)
* removed IWorkArea interface * split work area initialization * changed rect type in zoneset * tests upd work area tests removed obsolete, update others updated work area tests * get current vd windows * update windows positions * removed unused flag * moved update window positions to work area * check monitor * refactoring
This commit is contained in:
@@ -240,6 +240,31 @@ std::vector<std::pair<HWND, GUID>> VirtualDesktop::GetWindowsRelatedToDesktops()
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<HWND> VirtualDesktop::GetWindowsFromCurrentDesktop() const
|
||||
{
|
||||
using result_t = std::vector<HWND>;
|
||||
result_t windows;
|
||||
|
||||
auto callback = [](HWND window, LPARAM data) -> BOOL {
|
||||
result_t& result = *reinterpret_cast<result_t*>(data);
|
||||
result.push_back(window);
|
||||
return TRUE;
|
||||
};
|
||||
EnumWindows(callback, reinterpret_cast<LPARAM>(&windows));
|
||||
|
||||
std::vector<HWND> result;
|
||||
for (auto window : windows)
|
||||
{
|
||||
BOOL isOnCurrentVD{};
|
||||
if (m_vdManager->IsWindowOnCurrentVirtualDesktop(window, &isOnCurrentVD) == S_OK && isOnCurrentVD)
|
||||
{
|
||||
result.push_back(window);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
GUID VirtualDesktop::GetCurrentVirtualDesktopId() const noexcept
|
||||
{
|
||||
return m_currentVirtualDesktopId;
|
||||
|
||||
Reference in New Issue
Block a user