dotnet / dotnet/wpf

Window issue with two monitors when "show window contents while dragging" is disabled

Open
#1,334 0 comments 0 reactions 0 assignees View on GitHub
.NET Framework Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

@Kryptos-FR commented on [Thu Nov 10 2016](https://github.com/microsoft/WPF-Samples/issues/37)

Hello,

The recent DPI support in WPF (starting with .Net 4.6.2) is really nice. It helped us improve a lot our application.

However when moving a window from a monitor to another with a different DPI, the rendering is broken when the system advanced option *show window contents while dragging* is disabled. This issue can be reproduced with the **PerMonitorDPI** samples of this repository.

![performanceoptions](https://cloud.githubusercontent.com/assets/3006525/20201642/f6d761d4-a7fc-11e6-8ea7-b828de48a9f0.png)

Here are captures of what is happening:
![100% to 150%](https://cloud.githubusercontent.com/assets/3006525/20202318/b695ced0-a801-11e6-9da9-dbd1bd707575.png)
*moving from a monitor with 100% scale to another monitor with 150% scale*
![150% to 100%](https://cloud.githubusercontent.com/assets/3006525/20202322/c44b54dc-a801-11e6-8fd2-ff74a61828a8.png)
*moving from a monitor with 150% scale to another monitor with 100% scale*

Also note that this issue still happen in some cases even if the option *show window contents while dragging* is enabled. When using **Win+Arrows** keyboard shortcut to move the window to another monitor.

I tried to workaround it by forcing WPF to recalculate the layout or even with p/invoke some native Win32 API but it doesn't fix this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.