mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +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:
@@ -311,6 +311,9 @@
|
||||
<data name="FancyZones_AppLastZoneMoveWindows.Content" xml:space="preserve">
|
||||
<value>Move newly created windows to their last known zone</value>
|
||||
</data>
|
||||
<data name="FancyZones_OpenWindowOnActiveMonitor.Content" xml:space="preserve">
|
||||
<value>Move newly created windows to the current active monitor</value>
|
||||
</data>
|
||||
<data name="FancyZones_UseCursorPosEditorStartupScreen.Content" xml:space="preserve">
|
||||
<value>Follow mouse cursor instead of focus when launching editor in a multi screen environment</value>
|
||||
</data>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -133,6 +133,11 @@
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/>
|
||||
|
||||
<CheckBox x:Uid="FancyZones_OpenWindowOnActiveMonitor"
|
||||
IsChecked="{ Binding Mode=TwoWay, Path=OpenWindowOnActiveMonitor}"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/>
|
||||
|
||||
<CheckBox x:Uid="FancyZones_RestoreSize"
|
||||
IsChecked="{ Binding Mode=TwoWay, Path=RestoreSize}"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
|
||||
Reference in New Issue
Block a user