mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user