[FancyZones] Restore size of zoned windows (#4463)

* Started work

* I can't debug anything, cleaning

* Added settings, [[Not Tested]]

Not even compiled

* Tested, the most basic features work

* Refactor, add RestoreSize

* Added DPI awareness

* Fixed a potential issue with resizing zoned windows

* Fixup: Potentially unsafe memory-layout of std::pair replaced with std::array

* Fixup: Use .data() instead of a pointer

* Further refactoring

* Integrated Win+Arrow keys with the Restore size feature

* Fixed an issue where window's on-screen position is not restored properly

* Fixed a bug pointed out by Enrico
This commit is contained in:
Ivan Stošić
2020-07-01 15:36:05 +02:00
committed by GitHub
parent 16528888df
commit 4c08b591f1
21 changed files with 235 additions and 25 deletions

View File

@@ -74,6 +74,7 @@ namespace FancyZonesUnitTests
ptSettings.add_bool_toggle(L"fancyzones_displayChange_moveWindows", IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS, settings.displayChange_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_zoneSetChange_moveWindows", IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS, settings.zoneSetChange_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_appLastZone_moveWindows", IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS, settings.appLastZone_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_restoreSize", IDS_SETTING_DESCRIPTION_RESTORESIZE, settings.restoreSize);
ptSettings.add_bool_toggle(L"use_cursorpos_editor_startupscreen", IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN, settings.use_cursorpos_editor_startupscreen);
ptSettings.add_bool_toggle(L"fancyzones_show_on_all_monitors", IDS_SETTING_DESCRIPTION_SHOW_FANCY_ZONES_ON_ALL_MONITORS, settings.showZonesOnAllMonitors);
ptSettings.add_bool_toggle(L"fancyzones_makeDraggedWindowTransparent", IDS_SETTING_DESCRIPTION_MAKE_DRAGGED_WINDOW_TRANSPARENT, settings.makeDraggedWindowTransparent);
@@ -119,6 +120,7 @@ namespace FancyZonesUnitTests
.overrideSnapHotkeys = false,
.moveWindowAcrossMonitors = false,
.appLastZone_moveWindows = true,
.restoreSize = false,
.use_cursorpos_editor_startupscreen = true,
.zoneColor = L"#abafee",
.zoneBorderColor = L"FAFAFA",
@@ -148,6 +150,7 @@ namespace FancyZonesUnitTests
.overrideSnapHotkeys = false,
.moveWindowAcrossMonitors = false,
.appLastZone_moveWindows = true,
.restoreSize = false,
.use_cursorpos_editor_startupscreen = true,
.zoneColor = L"#FAFAFA",
.zoneBorderColor = L"#abafee",
@@ -177,6 +180,7 @@ namespace FancyZonesUnitTests
.overrideSnapHotkeys = false,
.moveWindowAcrossMonitors = false,
.appLastZone_moveWindows = true,
.restoreSize = false,
.use_cursorpos_editor_startupscreen = true,
.showZonesOnAllMonitors = false,
.makeDraggedWindowTransparent = true,
@@ -208,6 +212,7 @@ namespace FancyZonesUnitTests
.overrideSnapHotkeys = false,
.moveWindowAcrossMonitors = false,
.appLastZone_moveWindows = true,
.restoreSize = false,
.use_cursorpos_editor_startupscreen = true,
.showZonesOnAllMonitors = false,
.makeDraggedWindowTransparent = true,
@@ -239,6 +244,7 @@ namespace FancyZonesUnitTests
.overrideSnapHotkeys = false,
.moveWindowAcrossMonitors = false,
.appLastZone_moveWindows = true,
.restoreSize = false,
.use_cursorpos_editor_startupscreen = true,
.showZonesOnAllMonitors = false,
.makeDraggedWindowTransparent = true,
@@ -280,6 +286,7 @@ namespace FancyZonesUnitTests
ptSettings.add_bool_toggle(L"fancyzones_displayChange_moveWindows", IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS, settings.displayChange_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_zoneSetChange_moveWindows", IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS, settings.zoneSetChange_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_appLastZone_moveWindows", IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS, settings.appLastZone_moveWindows);
ptSettings.add_bool_toggle(L"fancyzones_restoreSize", IDS_SETTING_DESCRIPTION_RESTORESIZE, settings.restoreSize);
ptSettings.add_bool_toggle(L"use_cursorpos_editor_startupscreen", IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN, settings.use_cursorpos_editor_startupscreen);
ptSettings.add_bool_toggle(L"fancyzones_show_on_all_monitors", IDS_SETTING_DESCRIPTION_SHOW_FANCY_ZONES_ON_ALL_MONITORS, settings.showZonesOnAllMonitors);
ptSettings.add_bool_toggle(L"fancyzones_makeDraggedWindowTransparent", IDS_SETTING_DESCRIPTION_MAKE_DRAGGED_WINDOW_TRANSPARENT, settings.makeDraggedWindowTransparent);