mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[FancyZones] Open window on active monitor (#4361)
* Initial design for opening window on active monitor * Perform entire handling in DPI unaware thread * Codestyle improvement * Improve resizing mechanism and optimise code a bit * Remove unneeded code, make simple helper functions inline * Make this feature configurable * Code optimization, improve positioning for some applications * Retry positioning for certain applications * Improve readability * Address PR comments: Minor code style improvements * Remove retries in custom positioning * Position new toggle in settings menu
This commit is contained in:
@@ -28,6 +28,11 @@ enum class DisplayChangeType
|
||||
Initialization
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int CUSTOM_POSITIONING_LEFT_TOP_PADDING = 16;
|
||||
}
|
||||
|
||||
struct FancyZones : public winrt::implements<FancyZones, IFancyZones, IFancyZonesCallback, IZoneWindowHost>
|
||||
{
|
||||
public:
|
||||
@@ -413,12 +418,81 @@ void FancyZones::MoveWindowIntoZone(HWND window, winrt::com_ptr<IZoneWindow> zon
|
||||
}
|
||||
}
|
||||
|
||||
inline int RectWidth(const RECT& rect)
|
||||
{
|
||||
return rect.right - rect.left;
|
||||
}
|
||||
|
||||
inline int RectHeight(const RECT& rect)
|
||||
{
|
||||
return rect.bottom - rect.top;
|
||||
}
|
||||
|
||||
RECT FitOnScreen(const RECT& windowRect, const RECT& originMonitorRect, const RECT& destMonitorRect)
|
||||
{
|
||||
// New window position on active monitor. If window fits the screen, this will be final position.
|
||||
int left = destMonitorRect.left + (windowRect.left - originMonitorRect.left);
|
||||
int top = destMonitorRect.top + (windowRect.top - originMonitorRect.top);
|
||||
int W = RectWidth(windowRect);
|
||||
int H = RectHeight(windowRect);
|
||||
|
||||
if ((left < destMonitorRect.left) || (left + W > destMonitorRect.right))
|
||||
{
|
||||
// Set left window border to left border of screen (add padding). Resize window width if needed.
|
||||
left = destMonitorRect.left + CUSTOM_POSITIONING_LEFT_TOP_PADDING;
|
||||
W = min(W, RectWidth(destMonitorRect) - CUSTOM_POSITIONING_LEFT_TOP_PADDING);
|
||||
}
|
||||
if ((top < destMonitorRect.top) || (top + H > destMonitorRect.bottom))
|
||||
{
|
||||
// Set top window border to top border of screen (add padding). Resize window height if needed.
|
||||
top = destMonitorRect.top + CUSTOM_POSITIONING_LEFT_TOP_PADDING;
|
||||
H = min(H, RectHeight(destMonitorRect) - CUSTOM_POSITIONING_LEFT_TOP_PADDING);
|
||||
}
|
||||
|
||||
return { .left = left,
|
||||
.top = top,
|
||||
.right = left + W,
|
||||
.bottom = top + H };
|
||||
}
|
||||
|
||||
void OpenWindowOnActiveMonitor(HWND window, HMONITOR monitor) noexcept
|
||||
{
|
||||
// By default Windows opens new window on primary monitor.
|
||||
// Try to preserve window width and height, adjust top-left corner if needed.
|
||||
HMONITOR origin = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY);
|
||||
if (origin == monitor)
|
||||
{
|
||||
// Certain applications by design open in last known position, regardless of FancyZones.
|
||||
// If that position is on currently active monitor, skip custom positioning.
|
||||
return;
|
||||
}
|
||||
|
||||
WINDOWPLACEMENT placement{};
|
||||
if (GetWindowPlacement(window, &placement))
|
||||
{
|
||||
MONITORINFOEX originMi;
|
||||
originMi.cbSize = sizeof(originMi);
|
||||
if (GetMonitorInfo(origin, &originMi))
|
||||
{
|
||||
MONITORINFOEX destMi;
|
||||
destMi.cbSize = sizeof(destMi);
|
||||
if (GetMonitorInfo(monitor, &destMi))
|
||||
{
|
||||
RECT newPosition = FitOnScreen(placement.rcNormalPosition, originMi.rcWork, destMi.rcWork);
|
||||
SizeWindowToRect(window, newPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IFancyZonesCallback
|
||||
IFACEMETHODIMP_(void)
|
||||
FancyZones::WindowCreated(HWND window) noexcept
|
||||
{
|
||||
std::shared_lock readLock(m_lock);
|
||||
if (m_settings->GetSettings()->appLastZone_moveWindows && ShouldProcessNewWindow(window))
|
||||
const bool moveToAppLastZone = m_settings->GetSettings()->appLastZone_moveWindows;
|
||||
const bool openOnActiveMonitor = m_settings->GetSettings()->openWindowOnActiveMonitor;
|
||||
if ((moveToAppLastZone || openOnActiveMonitor) && ShouldProcessNewWindow(window))
|
||||
{
|
||||
HMONITOR primary = MonitorFromWindow(nullptr, MONITOR_DEFAULTTOPRIMARY);
|
||||
HMONITOR active = primary;
|
||||
@@ -429,11 +503,20 @@ FancyZones::WindowCreated(HWND window) noexcept
|
||||
active = MonitorFromPoint(cursorPosition, MONITOR_DEFAULTTOPRIMARY);
|
||||
}
|
||||
|
||||
const bool primaryActive = (primary == active);
|
||||
std::pair<winrt::com_ptr<IZoneWindow>, std::vector<int>> appZoneHistoryInfo = GetAppZoneHistoryInfo(window, active, primaryActive);
|
||||
if (!appZoneHistoryInfo.second.empty())
|
||||
bool windowZoned{ false };
|
||||
if (moveToAppLastZone)
|
||||
{
|
||||
MoveWindowIntoZone(window, appZoneHistoryInfo.first, appZoneHistoryInfo.second);
|
||||
const bool primaryActive = (primary == active);
|
||||
std::pair<winrt::com_ptr<IZoneWindow>, std::vector<int>> appZoneHistoryInfo = GetAppZoneHistoryInfo(window, active, primaryActive);
|
||||
if (!appZoneHistoryInfo.second.empty())
|
||||
{
|
||||
MoveWindowIntoZone(window, appZoneHistoryInfo.first, appZoneHistoryInfo.second);
|
||||
windowZoned = true;
|
||||
}
|
||||
}
|
||||
if (!windowZoned && openOnActiveMonitor)
|
||||
{
|
||||
m_dpiUnawareThread.submit(OnThreadExecutor::task_t{ [&] { OpenWindowOnActiveMonitor(window, active); } }).wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
PCWSTR name;
|
||||
bool* value;
|
||||
int resourceId;
|
||||
} m_configBools[11 /* 12 */] = { // "Turning FLASHING_ZONE option off"
|
||||
} m_configBools[12 /* 13 */] = { // "Turning FLASHING_ZONE option off"
|
||||
{ L"fancyzones_shiftDrag", &m_settings.shiftDrag, IDS_SETTING_DESCRIPTION_SHIFTDRAG },
|
||||
{ L"fancyzones_mouseSwitch", &m_settings.mouseSwitch, IDS_SETTING_DESCRIPTION_MOUSESWITCH },
|
||||
{ L"fancyzones_overrideSnapHotkeys", &m_settings.overrideSnapHotkeys, IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS },
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
{ L"fancyzones_displayChange_moveWindows", &m_settings.displayChange_moveWindows, IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS },
|
||||
{ L"fancyzones_zoneSetChange_moveWindows", &m_settings.zoneSetChange_moveWindows, IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS },
|
||||
{ L"fancyzones_appLastZone_moveWindows", &m_settings.appLastZone_moveWindows, IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS },
|
||||
{ L"fancyzones_openWindowOnActiveMonitor", &m_settings.openWindowOnActiveMonitor, IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR },
|
||||
{ L"fancyzones_restoreSize", &m_settings.restoreSize, IDS_SETTING_DESCRIPTION_RESTORESIZE },
|
||||
{ L"use_cursorpos_editor_startupscreen", &m_settings.use_cursorpos_editor_startupscreen, IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN },
|
||||
{ L"fancyzones_show_on_all_monitors", &m_settings.showZonesOnAllMonitors, IDS_SETTING_DESCRIPTION_SHOW_FANCY_ZONES_ON_ALL_MONITORS},
|
||||
|
||||
@@ -16,6 +16,7 @@ struct Settings
|
||||
bool overrideSnapHotkeys = false;
|
||||
bool moveWindowAcrossMonitors = false;
|
||||
bool appLastZone_moveWindows = false;
|
||||
bool openWindowOnActiveMonitor = false;
|
||||
bool restoreSize = false;
|
||||
bool use_cursorpos_editor_startupscreen = true;
|
||||
bool showZonesOnAllMonitors = false;
|
||||
|
||||
@@ -19,6 +19,7 @@ BEGIN
|
||||
IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR "Zone highlight color (Default #008CFF)"
|
||||
IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN "Follow mouse cursor instead of focus when launching editor in a multi screen environment"
|
||||
IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS "Move newly created windows to their last known zone"
|
||||
IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR "Move newly created windows to the current active monitor"
|
||||
IDS_SETTING_DESCRIPTION_RESTORESIZE "Restore the original size of windows when unsnapping"
|
||||
IDS_SETTING_LAUNCH_EDITOR_LABEL "Zone configuration"
|
||||
IDS_SETTING_LAUNCH_EDITOR_BUTTON "Edit zones"
|
||||
|
||||
@@ -25,16 +25,17 @@
|
||||
#define IDS_SETTING_DESCRIPTION_ZONE_BORDER_COLOR 111
|
||||
#define IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR 112
|
||||
#define IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS 113
|
||||
#define IDS_SETTING_DESCRIPTION_RESTORESIZE 114
|
||||
#define IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN 115
|
||||
#define IDS_SETTING_DESCRIPTION 116
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_LABEL 117
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_BUTTON 118
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION 119
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL 120
|
||||
#define IDS_SETTING_EXCLUDED_APPS_DESCRIPTION 121
|
||||
#define IDS_SETTINGS_HIGHLIGHT_OPACITY 122
|
||||
#define IDS_FANCYZONES 123
|
||||
#define IDS_CANT_DRAG_ELEVATED 124
|
||||
#define IDS_CANT_DRAG_ELEVATED_LEARN_MORE 125
|
||||
#define IDS_CANT_DRAG_ELEVATED_DIALOG_DONT_SHOW_AGAIN 126
|
||||
#define IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR 114
|
||||
#define IDS_SETTING_DESCRIPTION_RESTORESIZE 115
|
||||
#define IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN 116
|
||||
#define IDS_SETTING_DESCRIPTION 117
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_LABEL 118
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_BUTTON 119
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION 120
|
||||
#define IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL 121
|
||||
#define IDS_SETTING_EXCLUDED_APPS_DESCRIPTION 122
|
||||
#define IDS_SETTINGS_HIGHLIGHT_OPACITY 123
|
||||
#define IDS_FANCYZONES 124
|
||||
#define IDS_CANT_DRAG_ELEVATED 125
|
||||
#define IDS_CANT_DRAG_ELEVATED_LEARN_MORE 126
|
||||
#define IDS_CANT_DRAG_ELEVATED_DIALOG_DONT_SHOW_AGAIN 127
|
||||
|
||||
@@ -184,6 +184,7 @@ void Trace::SettingsChanged(const Settings& settings) noexcept
|
||||
TraceLoggingBoolean(settings.overrideSnapHotkeys, "OverrideSnapHotKeys"),
|
||||
TraceLoggingBoolean(settings.moveWindowAcrossMonitors, "MoveWindowAcrossMonitors"),
|
||||
TraceLoggingBoolean(settings.appLastZone_moveWindows, "MoveWindowsToLastZoneOnAppOpening"),
|
||||
TraceLoggingBoolean(settings.openWindowOnActiveMonitor, "OpenWindowOnActiveMonitor"),
|
||||
TraceLoggingBoolean(settings.restoreSize, "RestoreSize"),
|
||||
TraceLoggingBoolean(settings.use_cursorpos_editor_startupscreen, "UseCursorPosOnEditorStartup"),
|
||||
TraceLoggingBoolean(settings.showZonesOnAllMonitors, "ShowZonesOnAllMonitors"),
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace FancyZonesUnitTests
|
||||
Assert::AreEqual(expected.overrideSnapHotkeys, actual.overrideSnapHotkeys);
|
||||
Assert::AreEqual(expected.moveWindowAcrossMonitors, actual.moveWindowAcrossMonitors);
|
||||
Assert::AreEqual(expected.appLastZone_moveWindows, actual.appLastZone_moveWindows);
|
||||
Assert::AreEqual(expected.openWindowOnActiveMonitor, actual.openWindowOnActiveMonitor);
|
||||
Assert::AreEqual(expected.restoreSize, actual.restoreSize);
|
||||
Assert::AreEqual(expected.use_cursorpos_editor_startupscreen, actual.use_cursorpos_editor_startupscreen);
|
||||
Assert::AreEqual(expected.showZonesOnAllMonitors, actual.showZonesOnAllMonitors);
|
||||
@@ -112,6 +113,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -149,6 +151,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -180,6 +183,7 @@ namespace FancyZonesUnitTests
|
||||
.overrideSnapHotkeys = m_defaultSettings.overrideSnapHotkeys,
|
||||
.moveWindowAcrossMonitors = m_defaultSettings.moveWindowAcrossMonitors,
|
||||
.appLastZone_moveWindows = m_defaultSettings.appLastZone_moveWindows,
|
||||
.openWindowOnActiveMonitor = m_defaultSettings.openWindowOnActiveMonitor,
|
||||
.restoreSize = m_defaultSettings.restoreSize,
|
||||
.use_cursorpos_editor_startupscreen = m_defaultSettings.use_cursorpos_editor_startupscreen,
|
||||
.showZonesOnAllMonitors = m_defaultSettings.showZonesOnAllMonitors,
|
||||
@@ -224,6 +228,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -255,6 +260,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -287,6 +293,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -320,6 +327,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -434,6 +442,7 @@ namespace FancyZonesUnitTests
|
||||
.overrideSnapHotkeys = false,
|
||||
.moveWindowAcrossMonitors = false,
|
||||
.appLastZone_moveWindows = false,
|
||||
.openWindowOnActiveMonitor = false,
|
||||
.restoreSize = false,
|
||||
.use_cursorpos_editor_startupscreen = true,
|
||||
.showZonesOnAllMonitors = false,
|
||||
@@ -456,6 +465,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -573,6 +583,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_openWindowOnActiveMonitor", IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR, settings.openWindowOnActiveMonitor);
|
||||
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);
|
||||
@@ -602,6 +613,7 @@ namespace FancyZonesUnitTests
|
||||
values.add_property(L"fancyzones_overrideSnapHotkeys", expected.overrideSnapHotkeys);
|
||||
values.add_property(L"fancyzones_moveWindowAcrossMonitors", expected.moveWindowAcrossMonitors);
|
||||
values.add_property(L"fancyzones_appLastZone_moveWindows", expected.appLastZone_moveWindows);
|
||||
values.add_property(L"fancyzones_openWindowOnActiveMonitor", expected.openWindowOnActiveMonitor);
|
||||
values.add_property(L"fancyzones_restoreSize", expected.restoreSize);
|
||||
values.add_property(L"use_cursorpos_editor_startupscreen", expected.use_cursorpos_editor_startupscreen);
|
||||
values.add_property(L"fancyzones_show_on_all_monitors", expected.showZonesOnAllMonitors);
|
||||
@@ -638,6 +650,7 @@ namespace FancyZonesUnitTests
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_displayChange_moveWindows", IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS, expected.displayChange_moveWindows);
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_zoneSetChange_moveWindows", IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS, expected.zoneSetChange_moveWindows);
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_appLastZone_moveWindows", IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS, expected.appLastZone_moveWindows);
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_openWindowOnActiveMonitor", IDS_SETTING_DESCRIPTION_OPEN_WINDOW_ON_ACTIVE_MONITOR, expected.openWindowOnActiveMonitor);
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_restoreSize", IDS_SETTING_DESCRIPTION_RESTORESIZE, expected.restoreSize);
|
||||
m_ptSettings->add_bool_toggle(L"use_cursorpos_editor_startupscreen", IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN, expected.use_cursorpos_editor_startupscreen);
|
||||
m_ptSettings->add_bool_toggle(L"fancyzones_show_on_all_monitors", IDS_SETTING_DESCRIPTION_SHOW_FANCY_ZONES_ON_ALL_MONITORS, expected.showZonesOnAllMonitors);
|
||||
@@ -707,6 +720,7 @@ namespace FancyZonesUnitTests
|
||||
.overrideSnapHotkeys = false,
|
||||
.moveWindowAcrossMonitors = false,
|
||||
.appLastZone_moveWindows = true,
|
||||
.openWindowOnActiveMonitor = false,
|
||||
.restoreSize = false,
|
||||
.use_cursorpos_editor_startupscreen = true,
|
||||
.showZonesOnAllMonitors = false,
|
||||
|
||||
Reference in New Issue
Block a user