Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border being cuted in differents DPIs (125%, 175%) only Windows 10 and UWP #10216

Open
FernandoVeras opened this issue Dec 5, 2024 · 0 comments
Labels
bug Something isn't working team-Rendering Issue for the Rendering team

Comments

@FernandoVeras
Copy link

FernandoVeras commented Dec 5, 2024

Describe the bug

OS:

  • Widows 10 (22H2)

UWP:

  • Min version 17763
  • Target version 19041

I am facing difficulties understanding why borders are being clipped within the presentation tool inherited from the WinUI 2 Gallery.
Currently, I am encountering issues with borders when running applications on Windows 10 using UWP.

Image

I have an application where we use the native code from the WinUI 2 Gallery to demonstrate our components. On Windows 10, the borders are clipped even when there is sufficient space for them not to be.

At times, when resizing the screen, it becomes noticeable that the border is clipped. If we continue resizing, the border stops being clipped and then gets clipped again.

We also observed this behavior when implementing a border in a clean application. Although there is enough space, during some resizing moments, the border becomes thinner and does not maintain its intended size. However, it does not get clipped as it happens in the wrapper of the WinUI 2 Gallery.

We also noticed that the WinUI 2 Gallery itself uses a workaround to prevent this issue. It implements two borders, and at times, this second border becomes the main one, suppressing the problem.

Image

Currently, this issue does not occur on Windows 11, only on Windows 10.

While researching, we found some issues related to DPI awareness. However, in theory, UWP should handle this automatically, unlike WinUI, which requires configuration to avoid staying at 96 DPI for all monitors.

https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process
#1953
#1894
https://stackoverflow.com/questions/59631395/button-border-clipped-in-wpf-with-125-dpi-setting

Steps to reproduce the bug

  1. Using Windows 10
  2. Set High Contrast in your machine
  3. Go to WinUI 2 Gallery
  4. Open Buton example
  5. Scroll to Wrapping Buttons wih Large Content
  6. Verify the component uses two borders
  7. Resize the window making smaller
  8. See the borders collapse and turn one in some resize sizes

Expected behavior

Don't be necessary to use two borders or use variable margin to compenss this behavior

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

No response

@FernandoVeras FernandoVeras added the bug Something isn't working label Dec 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 5, 2024
@karkarl karkarl added team-Rendering Issue for the Rendering team and removed needs-triage Issue needs to be triaged by the area owners labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

2 participants