mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-22 22:50:03 +01:00
[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:
@@ -4,6 +4,7 @@
|
||||
#include <common/notifications.h>
|
||||
#include <common/notifications/fancyzones_notifications.h>
|
||||
#include <common/window_helpers.h>
|
||||
#include <common/dpi_aware.h>
|
||||
|
||||
#include "lib/Settings.h"
|
||||
#include "lib/ZoneWindow.h"
|
||||
@@ -297,6 +298,18 @@ void WindowMoveHandlerPrivate::MoveSizeEnd(HWND window, POINT const& ptScreen, c
|
||||
{
|
||||
::RemoveProp(window, MULTI_ZONE_STAMP);
|
||||
|
||||
if (m_settings->GetSettings()->restoreSize)
|
||||
{
|
||||
if (WindowMoveHandlerUtils::IsCursorTypeIndicatingSizeEvent())
|
||||
{
|
||||
::RemoveProp(window, RESTORE_SIZE_STAMP);
|
||||
}
|
||||
else
|
||||
{
|
||||
RestoreWindowSize(window);
|
||||
}
|
||||
}
|
||||
|
||||
auto monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL);
|
||||
if (monitor)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user