mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user