mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02: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;
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<value>Show zones on all monitors while dragging a window</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Span_Zones_Across_Monitors" xml:space="preserve">
|
||||
<value>Allow zones to span across monitors</value>
|
||||
<value>Allow zones to span across monitors (all monitors must have the same DPI scaling)</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Make_Dragged_Window_Transparent" xml:space="preserve">
|
||||
<value>Make dragged window transparent</value>
|
||||
@@ -213,4 +213,7 @@
|
||||
<data name="Powertoys_FancyZones" xml:space="preserve">
|
||||
<value>PowerToys - FancyZones</value>
|
||||
</data>
|
||||
<data name="Span_Across_Zones_Warning" xml:space="preserve">
|
||||
<value>The 'Allow zones to span across monitors' option requires all monitors to have the same DPI scaling to work properly.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user