Support Per-Monitor (V2): Fix Markdown preview misalignment after DPI change - #1988
Open
walterlv wants to merge 1 commit into
Open
Support Per-Monitor (V2): Fix Markdown preview misalignment after DPI change#1988walterlv wants to merge 1 commit into
walterlv wants to merge 1 commit into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSwitches DPI handling from explicit Per-Monitor V1 setup in code to proper Per-Monitor V2 configuration via application manifest, cleaning up obsolete DPI-awareness code and comments related to older .NET behavior. Sequence diagram for DPI awareness initialization change to Per-Monitor V2sequenceDiagram
participant Windows_OS
participant QuickLook_App
participant SHCore
rect rgb(230,230,230)
Windows_OS->>QuickLook_App: Load process (startup)
end
alt Before_PR_PerMonitor_V1
QuickLook_App->>QuickLook_App: static App constructor
QuickLook_App->>SHCore: SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)
SHCore-->>QuickLook_App: result
QuickLook_App->>QuickLook_App: RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly
else After_PR_PerMonitor_V2
Windows_OS->>Windows_OS: Read app.manifest (PerMonitorV2)
Windows_OS->>QuickLook_App: Initialize with Per-Monitor V2 DPI
QuickLook_App->>QuickLook_App: static App constructor
QuickLook_App->>QuickLook_App: RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Author
|
Previous fixes only swapped one Per-Monitor V1 setup for another. The real fix is to drop the buggy V1 path and use V2. I have verified this PR on my machine. Testing tip: The most reliable way to verify this fix is to preview a Markdown or HTML file. The important difference between Per-Monitor V1 and V2 is child-window DPI awareness; hosted WebView/browser HWNDs only pick up the correct scale under V2. WPF-only viewers can look fine on both, so they are easy to misread. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Brief Description of Changes
Please briefly describe the main changes in this PR:
I've written a blog post describing how to support Per-Monitor V2 correctly, especially on .NET Framework 4.6.2.
Previous related issues:
This PR is the correct fix for the issue, replacing the incorrect commit 97f8232.
Related Issue (if any)
Please provide related issue numbers: No related issues.
Additional Notes
Add any extra notes here:
Before:
▲ DPI 150% -> 100%
▲ DPI 100% -> 150%
After:
Summary by Sourcery
Enable Per-Monitor V2 DPI awareness to keep QuickLook windows correctly aligned and scaled across monitor DPI changes.
Bug Fixes:
Enhancements:
Chores: