[FancyZones] "Match not found" fix update for the single layout for all monitors (#11846)

This commit is contained in:
Seraphima Zykova 2021-06-23 20:46:02 +03:00 committed by GitHub
parent da1cdd7ca4
commit 8fcfcd6790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 29 deletions

View File

@ -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
{

View File

@ -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)
{