mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 01:08:18 +08:00
[FancyZones] "Match not found" fix update for the single layout for all monitors (#11846)
This commit is contained in:
parent
da1cdd7ca4
commit
8fcfcd6790
@ -116,35 +116,7 @@ namespace FancyZonesEditor
|
||||
|
||||
private int _currentDesktop;
|
||||
|
||||
public bool SpanZonesAcrossMonitors
|
||||
{
|
||||
get
|
||||
{
|
||||
return _spanZonesAcrossMonitors;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_spanZonesAcrossMonitors = value;
|
||||
|
||||
if (_spanZonesAcrossMonitors)
|
||||
{
|
||||
Rect workArea = default;
|
||||
Rect bounds = default;
|
||||
|
||||
foreach (Monitor monitor in Monitors)
|
||||
{
|
||||
workArea = Rect.Union(workArea, monitor.Device.WorkAreaRect);
|
||||
bounds = Rect.Union(bounds, monitor.Device.ScaledBounds);
|
||||
}
|
||||
|
||||
Monitors.Clear();
|
||||
Monitors.Add(new Monitor(bounds, workArea));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool _spanZonesAcrossMonitors;
|
||||
public bool SpanZonesAcrossMonitors { get; set; }
|
||||
|
||||
public bool MultiMonitorMode
|
||||
{
|
||||
|
@ -419,6 +419,19 @@ namespace FancyZonesEditor.Utils
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rect workArea = default;
|
||||
|
||||
foreach (NativeMonitorData nativeData in editorParams.Monitors)
|
||||
{
|
||||
Rect monitorWorkArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
workArea = Rect.Union(workArea, monitorWorkArea);
|
||||
}
|
||||
|
||||
var monitor = new Monitor(workArea, workArea);
|
||||
App.Overlay.AddMonitor(monitor);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user