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

Mac Catalyst on macOS does not render well when resizing an app #16690

Closed
ArchieCoder opened this issue May 11, 2024 · 22 comments
Closed

Mac Catalyst on macOS does not render well when resizing an app #16690

ArchieCoder opened this issue May 11, 2024 · 22 comments
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)

Comments

@ArchieCoder
Copy link
Contributor

Current behavior

Resizing the app causes multiple rendering issues

Screen.Recording.2024-05-11.at.8.28.04.AM.mov

Expected behavior

Rendering should be using full window only

How to reproduce it (as minimally and precisely as possible)

Contact me for the sample project

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Mac Catalyst

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@ArchieCoder ArchieCoder added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels May 11, 2024
@jeromelaban jeromelaban added platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..) and removed triage/untriaged Indicates an issue requires triaging or verification labels May 13, 2024
@ArchieCoder
Copy link
Contributor Author

White using the LiveCharts, I see this bad rendering on MacOS. There is also the black background that should be white like Windows and Linux.

I don't know if it is related with the library, skia or Uno.

image

@spouliot
Copy link
Contributor

Weird, it's like something is not aware of (all?) the resizing.

I don't know if it is related with the library, skia or Uno.

If it's fine with Windows and Linux then it's probably a Uno, macOS-specific issue.

Contact me for the sample project

Can you share a test case with me ? Sebastien at platform dot uno

Thanks!

@ArchieCoder ArchieCoder changed the title Skia on macOS does not render well when resizing an app Mac Catalyst on macOS does not render well when resizing an app May 21, 2024
@ajpinedam ajpinedam removed their assignment May 22, 2024
@agneszitte
Copy link
Contributor

Weird, it's like something is not aware of (all?) the resizing.

I don't know if it is related with the library, skia or Uno.

If it's fine with Windows and Linux then it's probably a Uno, macOS-specific issue.

Contact me for the sample project

Can you share a test case with me ? Sebastien at platform dot uno

Thanks!

@ArchieCoder not sure if you had the chance to send a test case to @spouliot for this issue

@ArchieCoder
Copy link
Contributor Author

@agneszitte the project was sent on May 21st, @spouliot replied: "je regarde ça asap" :)

FYI: Mac Catalyst is not target platform anymore for me when I learned more about it. Skia / Mac does the job.

It's up for the Uno team to close it or not since I won't use catalyst.

@agneszitte
Copy link
Contributor

@agneszitte the project was sent on May 21st, @spouliot replied: "je regarde ça asap" :)

FYI: Mac Catalyst is not target platform anymore for me when I learned more about it. Skia / Mac does the job.

It's up for the Uno team to close it or not since I won't use catalyst.

Thank you for the feedback @ArchieCoder, appreciated.
@spouliot will be able to look at this for Uno depending on the priorities on his side.

@spouliot
Copy link
Contributor

I can confirm that the provided code has issues with Catalyst (similar to the original video) but works fine on desktop/macOS.

OTOH the livechart looked good to me.

@ArchieCoder
Copy link
Contributor Author

FYI, I created this GitHub issue just in case it was a bug from the library last month beto-rodriguez/LiveCharts2#1512

@spouliot
Copy link
Contributor

Thanks, I'll follow up on that issue for the graph. It seems, at least partially, related to the animation and a later redraw makes it look good (but with a black background).

@spouliot
Copy link
Contributor

Same app/code running side-by-side on macOS

Screenshot 2024-06-20 at 10 02 01 AM

net8.0-desktop on the left side

  • Looks fine

net8.0-maccatalyst on the right side

Resize Issue

  • Looks smaller. In the above image it seems to fit the Height instead of the Width, which produce a grey band on the right.
    • Multiple resizing can show grey bands on both bottom and right sides. There seems to be a disconnect between the rendering size and the actual window size.

Live Chart Issue

  • Black backgrounds on live charts
  • Not visible in the first screenshot (see below) but updates on live charts do not seem to clear previous drawings (unless a redraw is made).
  • Graph rendering seems affected by DPI changes, e.g. when moving between 1x and 2x screens.
    • This is not something the original iOS code would had have to deal with...
Screenshot 2024-06-20 at 10 09 13 AM

@spouliot
Copy link
Contributor

Origin Resize Issue

Screenshot 2024-06-20 at 10 21 47 AM

After some resizing the catalyst app (right) can have a grey bar (incorrect origin?) at the top of the window too.

Variable Right Grey Band Size

The size of the "grey band" (on the right) is related to showing/hiding the left menu list. Depending on with width of the app's main window, this list is either:

  • visible, with both icon and text
  • visible, with icon only
  • not visible

Changing the state of the list leads to different band size as seen in the next 3 screenshots:

Screenshot 2024-06-20 at 2 57 39 PM Screenshot 2024-06-20 at 2 58 23 PM Screenshot 2024-06-20 at 2 58 59 PM

Fonts issue

The catalyst app does not find the Segoe UI fonts (see logs below) while this does not seem to be an issue with the desktop (skia) version.

That can explain why all the text looks smaller on the catalyst version, which in turn makes it show more content (since some elements are smaller). More a size issue than a resize issue.

[0:] Windows.UI.UIFontHelper: Warning: Failed to get system font based on Segoe UI-DemiBold
2024-06-20 10:31:38.233 ElementsTechnician[89326:160262623] W/Windows.UI.UIFontHelper: Failed to get system font based on Segoe UI-DemiBold 
[0:] 06-20 10:31:38.233-04:00 W/Windows.UI.UIFontHelper: Failed to get system font based on Segoe UI-DemiBold 
[0:] Windows.UI.UIFontHelper: Warning: Failed to get system font based on XamlAutoFontFamily

The lack of this font (on some platforms, like macOS) is a known issue: #3954

@jeromelaban
Copy link
Member

The fonts issue is being address, apps will use OpenSans by default.

@spouliot
Copy link
Contributor

The main issue (resize) seems related to the NavigationView and how it adapts the sizes of its parts depending on the conditions (width and height).

It has some iOS specific code (that would also be used by Catalyst) but I'm not convinced it's the (only) problem (still next thing to try).

The fact that you don't often resize iOS apps (well never but a bit more often for iPadOS apps) is likely why this was not spotted earlier.

The 2nd issue is very likely unrelated (or I missed something) and might to be a transparency issue - where it should not be transparent and overpaint the whole graph.

@ajpinedam
Copy link
Contributor

Hey @ArchieCoder can you please attach/share a sample app or at least the XAML I could use to reproduce this issue? I will be looking into this, following @spouliot findings.

@ArchieCoder
Copy link
Contributor Author

@ajpinedam I sent my project a while ago to @spouliot. If he is not available, send me your email and I will forward the email.

@spouliot
Copy link
Contributor

@ArchieCoder just back home, I forwarded your email w/attachment to @ajpinedam

@ajpinedam
Copy link
Contributor

Thanks @spouliot :)

@spouliot spouliot removed their assignment Jul 13, 2024
@beto-rodriguez
Copy link

beto-rodriguez commented Sep 13, 2024

updates on live charts do not seem to clear previous drawings (unless a redraw is made)

@spouliot On the LiveCharts side, clearing the canvas is something we do depending on the UI framework, some frameworks require it, some frameworks don't.

In the specific case of Uno, all the supported platforms do not require to clear the canvas, but on catalyst it seems that it behaves different, should this be handled in the LiveCharts side?

@spouliot
Copy link
Contributor

should this be handled in the LiveCharts side?

@beto-rodriguez No. The Mac backend should behave identically with the others. If it does not it's a bug :)

I suspect some optimizations are the problem - it's just not common to see the issue so I have not noticed. I'll look harder :D

@ajpinedam ajpinedam removed their assignment Jan 11, 2025
@d2dyno1
Copy link

d2dyno1 commented Mar 8, 2025

Any updates on this issue?

@jeromelaban
Copy link
Member

@d2dyno1 have you been able to test with the net9.0-desktop variant instead of using Catalyst? Is there a specific reason you need Catalyst for your app?

@spouliot
Copy link
Contributor

@jeromelaban I think @d2dyno1 is referring in a different issue (on netXX-desktop) that was mentioned in later, not the original one (on netXX-maccatalyst)

I'll double-check the status and, if needed, open a separate issue for it.

@spouliot
Copy link
Contributor

new issue @ #19675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)
Projects
None yet
Development

No branches or pull requests

8 participants