Repository navigation
Support Per-Monitor (V2): Fix Markdown preview misalignment after DPI change - #1988
Merged
Merged
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
|
Contributor
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. |
Member
|
This is good PR. |
walterlv
force-pushed
the
t/walterlv/per-monitor-v2
branch
from
October 12, 2026 01:37
06dd108 to
33dcad0
Compare
bencsmartucph
added a commit
to bencsmartucph/QuickLook.Plugin.StickyPosition
that referenced
this pull request
Oct 18, 2026
preview-steps.ps1 opens previews on a chosen monitor through QuickLook's pipe (a magenta backdrop makes that monitor the foreground one) and prints or captures the window; build-debug.ps1 installs a build that logs every placement message, without changing Plugin.cs. These found on 18 Oct that the misaligned Markdown preview after docking was QuickLook's DPI handling (fixed upstream in QL-Win/QuickLook#1988), not StickyPosition's placement, and make the check repeatable when QuickLook 4.6 ships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adopt Per-Monitor V2 DPI awareness to keep the Markdown preview and window layout correctly aligned after display scaling changes.
New Features:
Bug Fixes:
Enhancements: