[FancyZones]Fix for the scenario of layout reset when opening the FZEditor (#28556)

* rename

* moved applied layouts tests

* changed work area id comparison

* changed save

* changed apply

* changed clone

* sync applied layouts

* save last used vd

* replace parent work area ids

* proper time for sync

* sync layouts considering last used virtual desktop

* use ids from work areas on editor opening

* update applied layouts tests

* sync app zone history vd

* fix test

* release build fix

* app zone history comparison

* pass last used vd to sync

* clean up unused

* dpi unaware values

* update GUID_NULL

* use registry values only

* added more tests

* fix failing scenario

* added replace condition to zone history

* sync time

* log

* spellcheck

* fix pch in project

* fixed cloning layout
This commit is contained in:
Seraphima Zykova
2023-09-21 13:47:56 +03:00
committed by GitHub
parent 8cd2b7cdc3
commit 890b7f4286
21 changed files with 860 additions and 495 deletions

View File

@@ -0,0 +1,58 @@
#pragma once
#include <FancyZonesLib/FancyZonesDataTypes.h>
class WorkArea;
class WorkAreaConfiguration
{
public:
/**
* Get work area based on monitor handle.
*
* @param[in] monitor Monitor handle.
*
* @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).
*/
WorkArea* const GetWorkArea(HMONITOR monitor) const;
/**
* Get work area based on the current cursor position.
*
* @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).
*/
WorkArea* const GetWorkAreaFromCursor() const;
/**
* Get work area on which specified window is located.
*
* @param[in] window Window handle.
*
* @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).
*/
WorkArea* const GetWorkAreaFromWindow(HWND window) const;
/**
* @returns All registered work areas.
*/
const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& GetAllWorkAreas() const noexcept;
/**
* Register new work area.
*
* @param[in] monitor Monitor handle.
* @param[in] workAra Object representing single work area.
*/
void AddWorkArea(HMONITOR monitor, std::unique_ptr<WorkArea> workArea);
/**
* Clear all persisted work area related data.
*/
void Clear() noexcept;
private:
std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>> m_workAreaMap;
};