[FancyZones] Added persistence to app zone history (#3132)

* Persist app zone history in a separate file

* Almost ready to be functionally tested

* Now all unit tests pass

* Bug fixes, it seems to work

* Various fixups

* Improved performance of FancyZones::UpdateWindowsPositions()
This commit is contained in:
Ivan Stošić
2020-05-26 16:01:12 +02:00
committed by GitHub
parent bc9add783c
commit 6f22c7ad19
17 changed files with 349 additions and 881 deletions

View File

@@ -134,7 +134,7 @@ namespace JSONHelpers
{
std::wstring zoneSetUuid;
std::wstring deviceId;
int zoneIndex;
std::vector<int> zoneIndexSet;
};
struct AppZoneHistoryJSON
@@ -174,6 +174,12 @@ namespace JSONHelpers
{
return jsonFilePath;
}
inline const std::wstring& GetPersistAppZoneHistoryFilePath() const
{
return appZoneHistoryFilePath;
}
json::JsonObject GetPersistFancyZonesJSON();
std::optional<DeviceInfoData> FindDeviceInfo(const std::wstring& zoneWindowId) const;
@@ -236,9 +242,9 @@ namespace JSONHelpers
void UpdatePrimaryDesktopData(const std::wstring& desktopId);
void RemoveDeletedDesktops(const std::vector<std::wstring>& activeDesktops);
int GetAppLastZoneIndex(HWND window, const std::wstring_view& deviceId, const std::wstring_view& zoneSetId) const;
std::vector<int> GetAppLastZoneIndexSet(HWND window, const std::wstring_view& deviceId, const std::wstring_view& zoneSetId) const;
bool RemoveAppLastZone(HWND window, const std::wstring_view& deviceId, const std::wstring_view& zoneSetId);
bool SetAppLastZone(HWND window, const std::wstring& deviceId, const std::wstring& zoneSetId, int zoneIndex);
bool SetAppLastZones(HWND window, const std::wstring& deviceId, const std::wstring& zoneSetId, const std::vector<int>& zoneIndexSet);
void SetActiveZoneSet(const std::wstring& deviceId, const ZoneSetData& zoneSet);
@@ -268,6 +274,7 @@ namespace JSONHelpers
std::wstring activeDeviceId;
std::wstring jsonFilePath;
std::wstring appZoneHistoryFilePath;
};
FancyZonesData& FancyZonesDataInstance();