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

[Windows] FlexLayout crashes when using a custom display scale factor value (regression) #22209

Closed
BurkusCat opened this issue May 4, 2024 · 6 comments · Fixed by #22411
Closed
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version layout-flex FlexLayout issues platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@BurkusCat
Copy link
Contributor

Description

When using a custom display scale factor in Windows, FlexLayout appears to throw an exception.
image

The exception is:
{Microsoft.UI.Xaml.UnhandledExceptionEventArgs} Layout cycle detected. Layout could not complete.

This a regression I think. 8.0.7 didn't appear to have the crash. The latest nightly (8.0.40-nightly.10602) does not resolve the issue.

Steps to Reproduce

  1. Create a new MAUI app
  2. Put a ScrollView on the page with a VerticalStackLayout inside
  3. Put a FlexLayout inside that
  4. Set a custom display scaling factor (110% or 170% were two random ones I tried)
  5. In case its relevant, set screen resolution to 5120x1440
  6. Start app on Windows

Expected
App starts

Actual
App crashes on startup

Link to public reproduction project repository

https://github.com/BurkusCat/FlexLayoutDisplayScaleCrash

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.7 SR2

Affected platforms

Windows

Affected platform versions

Windows 23H2 22631.3527

Did you find any workaround?

No

Relevant log output

No response

@BurkusCat BurkusCat added the t/bug Something isn't working label May 4, 2024
Copy link
Contributor

github-actions bot commented May 4, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@BurkusCat
Copy link
Contributor Author

Hi I'm an AI powered bot that finds similar issues based off the issue title.

I think there are a lot of related FlexLayout issues (I've experienced #21970). This seems like a unique issue that on FlexLayouts that would otherwise work, custom display scaling causes a crash with even a simple layout.

@jfversluis jfversluis added platform/windows 🪟 area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-flex FlexLayout issues potential-regression This issue described a possible regression on a currently supported version., verification pending labels May 4, 2024
@ninachen03 ninachen03 added s/triaged Issue has been reviewed and removed s/triaged Issue has been reviewed labels May 6, 2024
@jaosnz-rep
Copy link
Collaborator

jaosnz-rep commented May 6, 2024

The error can be reproduced on the 8.0.20, 8.0.21 and 8.0.40-nightly.10602 versions, but verified on 8.0.14 that it works fine.

@jaosnz-rep jaosnz-rep added i/regression This issue described a confirmed regression on a currently supported version s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels May 6, 2024
@PureWeen PureWeen added this to the .NET 8 SR5 milestone May 7, 2024
@jeremy-visionaid
Copy link
Contributor

Oh yup, I just hit this one too, and sadly setting the maximum width/height (like for #21970) is ineffective as a workaround.

@jeremy-visionaid
Copy link
Contributor

Eek, it's not just custom display factors. It seems to be machine specific, but it can also happen on the device's default/recommended scale factor (e.g. 200% on a 2560x1600 laptop). It also occurs at 175% on Surface Pro 7. So it turns out this is quite common in the field - more than 50% of devices are affected on my app's canary release channel.

@BurkusCat
Copy link
Contributor Author

That's quite interesting! 😯 I tested several standard scale factors and it worked fine for me. I just assumed it was only custom! I only tested on one monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version layout-flex FlexLayout issues platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants