[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:
vldmr11080
2020-07-08 10:37:42 +02:00
committed by GitHub
parent 94f66b812a
commit db229cf1bf
12 changed files with 170 additions and 19 deletions

View File

@@ -44,6 +44,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
this._displayChangemoveWindows = Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value;
this._zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
this._appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
this._openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value;
this._restoreSize = Settings.Properties.FancyzonesRestoreSize.Value;
this._useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value;
this._showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value;
@@ -83,6 +84,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private bool _displayChangemoveWindows;
private bool _zoneSetChangeMoveWindows;
private bool _appLastZoneMoveWindows;
private bool _openWindowOnActiveMonitor;
private bool _restoreSize;
private bool _useCursorPosEditorStartupScreen;
private bool _showOnAllMonitors;
@@ -243,6 +245,24 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool OpenWindowOnActiveMonitor
{
get
{
return _openWindowOnActiveMonitor;
}
set
{
if (value != _openWindowOnActiveMonitor)
{
_openWindowOnActiveMonitor = value;
Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value = value;
RaisePropertyChanged();
}
}
}
public bool RestoreSize
{
get