dotnet / dotnet/wpf

Window overflows to second screen after it is snapped to desktop top

Open
#2,242 18 comments 3 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Hi there,

I am using a Window with a custom WindowChrome. This caused many bugs over the last year. The initial bug was, that when the window is maximized the window size is calculated bigger than the screen, so that part of the window content is clipped at the edges.

To overcome this I added a margin between the window and its content, when the window is maximized. After that I had problems with wrong window size calculations with undocked task bars, multiple monitors and different dpi scalings. After several iterations I resolved such issues by handling WM_GETMINMAXINFO.

Now a new bug arrived, that says that a black border is visible on the second screen, when the window is maximized by snapping it to the top of the first screen. The border does not appear when I maximize the window by double clicking the caption or by pressing the maximize button. Is this a bug? If not, is there a way to detect that a window is maximized through snapping, to handle it differently?

Thanks,
Arthur

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.