[FancyZones] Update 'span zones across monitors' feature description and add message box warning accordingly (#6381)

* Update span accross monitors feature description in Settings App

* Add warning if scalings are different

* Address PR comments

* Address comment
This commit is contained in:
stefansjfw
2020-09-07 12:24:13 +02:00
committed by GitHub
parent 4ff888b2b0
commit 3c76942799
3 changed files with 31 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#include "pch.h"
#include <common/common.h>
#include <common/dpi_aware.h>
#include <common/on_thread_executor.h>
#include <common/window_helpers.h>
@@ -18,6 +19,8 @@
#include <lib/SecondaryMouseButtonsHook.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;
enum class DisplayChangeType
{
WorkArea,
@@ -628,6 +631,29 @@ void FancyZones::ToggleEditor() noexcept
allMonitors = FancyZonesUtils::GetAllMonitorRects<&MONITORINFOEX::rcWork>();
} }).wait();
UINT currentDpi = 0;
for (const auto& monitor : allMonitors)
{
UINT dpiX = 0;
UINT dpiY = 0;
if (GetDpiForMonitor(monitor.first, MDT_EFFECTIVE_DPI, &dpiX, &dpiY) == S_OK)
{
if (currentDpi == 0)
{
currentDpi = dpiX;
continue;
}
if (currentDpi != dpiX)
{
MessageBoxW(NULL,
GET_RESOURCE_STRING(IDS_SPAN_ACROSS_ZONES_WARNING).c_str(),
GET_RESOURCE_STRING(IDS_POWERTOYS_FANCYZONES).c_str(),
MB_OK | MB_ICONWARNING);
break;
}
}
}
for (auto& [monitor, workArea] : allMonitors)
{
const auto x = workArea.left;