Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Maximizing window on a high-DPI monitor causes window buttons to go off the screen

Open PathogenDavid opened this issue 3 years ago • 2 comments

Environment

Observed with both XamlControlsGallery and Synfonia (The former uses 0.10.0-preview5 and the latter appears to use the latest CI build.)

Windows 10 2004

I have four monitors: (I'm including the entire desktop layout for clarity. The relevant monitor is DISPLAY4.)

Monitor DISPLAY4 DISPLAY3 DISPLAY1 DISPLAY2
DPI 200% 100% 100% 100%
Resolution 3840x2160 1920x1080 1920x1080 1920x1080
Position -5760, -1080 -1920, 0 0, 0 1920, 0

DISPLAY1 is set as the primary monitor.

Steps to reproduce

  1. Launch the Avalonia app
  2. Maximize the app (either by double-clicking the title bar or clicking the maximize button.)
  3. Restore the app (again either by double-clicking the title bar or clicking the maximize button.)

Expected behavior

Everything looks normal

Actual behavior

When maximized (after step 2) the window buttons are clipped off the top of the screen:

image

When restored (after step 3) the window buttons are still slightly jank:

image

Other information

Maximizing and restoring the "damaged" window on a 100% DPI monitor fixes it:

image

The window buttons are only messed up after the maximize+restore sequence, they look fine if you just drag the window over:

image

PathogenDavid avatar Sep 27 '20 22:09 PathogenDavid