[FancyZones] Improve code quality (part 5: work area initialization) (#23671)

This commit is contained in:
Seraphima Zykova
2023-01-31 12:55:46 +03:00
committed by GitHub
parent c1c14b4f2e
commit fcd05f2f51
12 changed files with 469 additions and 627 deletions

View File

@@ -6,10 +6,10 @@ class WorkArea;
class WindowDrag
{
WindowDrag(HWND window, const std::unordered_map<HMONITOR, std::shared_ptr<WorkArea>>& activeWorkAreas);
WindowDrag(HWND window, const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& activeWorkAreas);
public:
static std::unique_ptr<WindowDrag> Create(HWND window, const std::unordered_map<HMONITOR, std::shared_ptr<WorkArea>>& activeWorkAreas);
static std::unique_ptr<WindowDrag> Create(HWND window, const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& activeWorkAreas);
~WindowDrag();
bool MoveSizeStart(HMONITOR monitor, bool isSnapping);
@@ -38,8 +38,8 @@ private:
const HWND m_window;
WindowProperties m_windowProperties; // MoveSizeWindowInfo of the window at the moment when dragging started
const std::unordered_map<HMONITOR, std::shared_ptr<WorkArea>>& m_activeWorkAreas; // all WorkAreas on current virtual desktop, mapped with monitors
std::shared_ptr<WorkArea> m_currentWorkArea; // "Active" WorkArea, where the move/size is happening. Will update as drag moves between monitors.
const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& m_activeWorkAreas; // all WorkAreas on current virtual desktop, mapped with monitors
WorkArea* m_currentWorkArea; // "Active" WorkArea, where the move/size is happening. Will update as drag moves between monitors.
bool m_snappingMode{ false };