Skip to content

Conversation

@Memphizzz
Copy link

Summary of the Pull Request

Use DPI-unaware context when positioning overlay windows to match the coordinate space from the C++ backend.

The FancyZones editor overlay windows were incorrectly positioned on secondary monitors when using different DPI scaling (e.g., 125%/150%/125%). Zones appeared shifted or clipped because they extended past monitor edges.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Root Cause

The C++ backend uses a DPI-unaware thread to get virtual screen coordinates, but the WPF editor (PerMonitorV2 DPI-aware) interpreted these coordinates with DPI scaling applied, causing misalignment on non-primary monitors.

Fix

  • EditorParameters.cpp: Use consistent virtual coordinates for all monitor properties (removed DPIAware::Convert that was only applied to dimensions)
  • Monitor.cs: Reposition overlay windows using DPI-unaware context after HWND creation, matching the coordinate space from C++ backend
  • NativeMethods.cs: Added SetWindowPositionDpiUnaware() using SetThreadDpiAwarenessContext to temporarily switch DPI awareness

Validation Steps Performed

Manually tested on 3-monitor setup with 125%/150%/125% DPI scaling - overlays now correctly cover each monitor's work area.


🤖 This fix was developed with Claude Code after 6 hours of debugging DPI coordinate systems together.

Use DPI-unaware context when positioning overlay windows to match the coordinate space from the C++ backend.

Co-Authored-By: Claude <noreply@anthropic.com>
@Memphizzz
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FancyZones - Not Capturing full screen FancyZones not using full screen

1 participant