mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +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:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "GuidUtils.h"
|
||||
|
||||
interface IWorkArea;
|
||||
class WorkArea;
|
||||
struct ZoneColors;
|
||||
enum struct OverlappingZonesAlgorithm;
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
* @returns Object representing single work area, interface to all actions available on work area
|
||||
* (e.g. moving windows through zone layout specified for that work area).
|
||||
*/
|
||||
winrt::com_ptr<IWorkArea> GetWorkArea(const GUID& desktopId, HMONITOR monitor);
|
||||
std::shared_ptr<WorkArea> GetWorkArea(const GUID& desktopId, HMONITOR monitor);
|
||||
|
||||
/**
|
||||
* Get work area based on virtual desktop id and the current cursor position.
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
* @returns Object representing single work area, interface to all actions available on work area
|
||||
* (e.g. moving windows through zone layout specified for that work area).
|
||||
*/
|
||||
winrt::com_ptr<IWorkArea> GetWorkAreaFromCursor(const GUID& desktopId);
|
||||
std::shared_ptr<WorkArea> GetWorkAreaFromCursor(const GUID& desktopId);
|
||||
|
||||
/**
|
||||
* Get work area on which specified window is located.
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
* @returns Object representing single work area, interface to all actions available on work area
|
||||
* (e.g. moving windows through zone layout specified for that work area).
|
||||
*/
|
||||
winrt::com_ptr<IWorkArea> GetWorkArea(HWND window, const GUID& desktopId);
|
||||
std::shared_ptr<WorkArea> GetWorkArea(HWND window, const GUID& desktopId);
|
||||
|
||||
/**
|
||||
* Get map of all work areas on single virtual desktop. Key in the map is monitor handle, while value
|
||||
@@ -49,12 +49,12 @@ public:
|
||||
*
|
||||
* @returns Map containing pairs of monitor and work area for that monitor (within same virtual desktop).
|
||||
*/
|
||||
const std::unordered_map<HMONITOR, winrt::com_ptr<IWorkArea>>& GetWorkAreasByDesktopId(const GUID& desktopId);
|
||||
const std::unordered_map<HMONITOR, std::shared_ptr<WorkArea>>& GetWorkAreasByDesktopId(const GUID& desktopId);
|
||||
|
||||
/**
|
||||
* @returns All registered work areas.
|
||||
*/
|
||||
std::vector<winrt::com_ptr<IWorkArea>> GetAllWorkAreas();
|
||||
std::vector<std::shared_ptr<WorkArea>> GetAllWorkAreas();
|
||||
|
||||
/**
|
||||
* Register new work area.
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
* @param[in] monitor Monitor handle.
|
||||
* @param[in] workAra Object representing single work area.
|
||||
*/
|
||||
void AddWorkArea(const GUID& desktopId, HMONITOR monitor, winrt::com_ptr<IWorkArea>& workArea);
|
||||
void AddWorkArea(const GUID& desktopId, HMONITOR monitor, std::shared_ptr<WorkArea>& workArea);
|
||||
|
||||
/**
|
||||
* Check if work area is already registered.
|
||||
@@ -89,5 +89,5 @@ public:
|
||||
|
||||
private:
|
||||
// Work area is uniquely defined by monitor and virtual desktop id.
|
||||
std::unordered_map<GUID, std::unordered_map<HMONITOR, winrt::com_ptr<IWorkArea>>> workAreaMap;
|
||||
std::unordered_map<GUID, std::unordered_map<HMONITOR, std::shared_ptr<WorkArea>>> workAreaMap;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user