Jump to content
Wil van Antwerpen

macOS Sonoma and UI layout

Recommended Posts

Had some customers upgrade to macOS Sonoma.

 

My app doesn't work on Sonoma as it has various problems.

The main -in your face- issue though is that the layout of the application is completely messed up. Making it completely unusable.

It's like you're using a magnification application on top of the app, it shows a snippet of the user interface and there doesn't seem to be a way to get it to look normal.

 

Anyone else seen this?
Tried with Delphi 10.4 as well as Delphi 11.3

So far only tested against macOS Sonoma on the intel platform. But it would surprise me if it hasn't the same issue on Arm.

--
Wil

Share this post


Link to post
48 minutes ago, Wil van Antwerpen said:

Anyone else seen this?

I've seen similar issues reported on social media groups. I'll be testing it myself later

Share this post


Link to post

Thanks Dave.
Good to know I'm not alone. Currently trying to use newer versions of the SDK to see if that makes a difference.
So far no luck, but I was using some pretty dated SDK's, so I'm slowly working my way to something current.

I take it that this was only reported in Delphi groups?

Share this post


Link to post

ah facebook.. haven't signed in there in many months, not my thing.
Signed up to those groups now, I suspect it is the same issue.
With SDK12.1 my app didn't even start via 10.4.. let's try SDK13.1 from 11.3 (not getting bored)

edit: also didn't start. Probably a red herring.
Will chase that tomorrow, pulling an all nighter isn't going to help speed things up I think.

Edited by Wil van Antwerpen

Share this post


Link to post

I always love how Apple breaks our apps with each subsequent release!  There are still various internal issues with Ventura causing random floating point exceptions that crash Delphi apps that have yet to be resolved by Apple.

  • Like 1

Share this post


Link to post

I am experiencing the same issue. Inserting the following line after the application.initialidid help the resolution issue, but TPaintBox causes rendering problem not only the TPaintBox component itself but it affects to the entire form. I don't know if TPaintBox is really the key or not, but forms without TPaintBox seem working fine. Please let me know if you know how to fix this.

begin
  Application.Initialize;
  GlobalUseMetal := true;  // <-- Inserted this line.
  Application.CreateForm(TfrmLeat, frmLeat);

By the way, it sounds like the original application (without GlobalUseMetal) works no problem with an external monitor.

Share this post


Link to post

I found the original program works if you go to MacOS settings - Displays. Then change the resolution from the default to the maximum available. It didn't work for one of my customers though, so maybe I just got lucky.

 

When I tried GlobalUseMetal:=true, my program doesn't start. The icon just bounces up and down until I terminate it. This is with both MacOS 14.0 and 13.1

Share this post


Link to post
25 minutes ago, dpsoftware said:

I found the original program works if you go to MacOS settings - Displays. Then change the resolution from the default to the maximum available. It didn't work for one of my customers though, so maybe I just got lucky.

 

When I tried GlobalUseMetal:=true, my program doesn't start. The icon just bounces up and down until I terminate it. This is with both MacOS 14.0 and 13.1

Curious.. are you testing in a VM or on recent macOS hardware that supports macOS Sonoma natively?
I'm asking as most VM's won't have metal support. There's also OCLP to get Sonoma running on older hardware and also wonder how good the metal support is on them.
I haven't verified it myself yet, but I doubt that this setting works well if metal isn't available.

--
Wil

Edited by Wil van Antwerpen

Share this post


Link to post
7 hours ago, Wil van Antwerpen said:

Curious.. are you testing in a VM or on recent macOS hardware that supports macOS Sonoma natively?
I'm asking as most VM's won't have metal support. There's also OCLP to get Sonoma running on older hardware and also wonder how good the metal support is on them.
I haven't verified it myself yet, but I doubt that this setting works well if metal isn't available.

The MacOS 13.1 is native on an M1 MacBook Pro and the 14.0 is a virtual machine using parallels 

Share this post


Link to post
16 hours ago, dpsoftware said:

The MacOS 13.1 is native on an M1 MacBook Pro and the 14.0 is a virtual machine using parallels 

That is curious indeed as the M1 MBP would certainly support Metal without any issues.
Not sure about the VM on Parallels.

Share this post


Link to post

Maybe the following is a proper solution (at least until Embarcadero gets their act together):

 

Scaling issue on macOS 14 (Sonoma)
Using Delphi 11.3 (and probably earlier), apps on macOS 14 (Sonoma) may appear to have the wrong scale, depending on the screen resolution. This is an official workaround based on this Quality Portal report.


1. Copy FMX.Platform.Mac.pas from the source\fmx folder and put it in the search path for your project, e.g., the same folder as the project, or add the unit directly to your project in project manager. (Remeber to remove the read-only attribute from the file before you start making any changes).
2. Modify the TMacWindowHandle.GetScale method as follows:

 

function TMacWindowHandle.GetScale: Single;
begin
  if TOSVersion.Check(14) and not GlobalUseMetal then
    Result := 1
  else
    Result := Wnd.backingScaleFactor;
end;

 

 

This is not mine, I found it on one of the social networks. Normally I would post a link but this forum page flagged it as spam. For that reason I copied and pasted the text.

  • Like 1

Share this post


Link to post
8 hours ago, futuron said:

Maybe the following is a proper solution (at least until Embarcadero gets their act together):

 

Scaling issue on macOS 14 (Sonoma)
Using Delphi 11.3 (and probably earlier), apps on macOS 14 (Sonoma) may appear to have the wrong scale, depending on the screen resolution. This is an official workaround based on this Quality Portal report.


1. Copy FMX.Platform.Mac.pas from the source\fmx folder and put it in the search path for your project, e.g., the same folder as the project, or add the unit directly to your project in project manager. (Remeber to remove the read-only attribute from the file before you start making any changes).
2. Modify the TMacWindowHandle.GetScale method as follows:

 

function TMacWindowHandle.GetScale: Single;
begin
  if TOSVersion.Check(14) and not GlobalUseMetal then
    Result := 1
  else
    Result := Wnd.backingScaleFactor;
end;

 

 

This is not mine, I found it on one of the social networks. Normally I would post a link but this forum page flagged it as spam. For that reason I copied and pasted the text.

The code above indeed does come from Embarcadero. I searched the site for GlobalUseMetal in the past year to find this.

 

See https://quality.embarcadero.com/browse/RSP-42424
 

Edited by Tom F

Share this post


Link to post
On 9/29/2023 at 6:23 AM, luthier said:

I am experiencing the same issue. Inserting the following line after the application.initialidid help the resolution issue, but TPaintBox causes rendering problem not only the TPaintBox component itself but it affects to the entire form. I don't know if TPaintBox is really the key or not, but forms without TPaintBox seem working fine. Please let me know if you know how to fix this.


begin
  Application.Initialize;
  GlobalUseMetal := true;  // <-- Inserted this line.
  Application.CreateForm(TfrmLeat, frmLeat);

By the way, it sounds like the original application (without GlobalUseMetal) works no problem with an external monitor.

Based on my own results and consistent with what I read on https://quality.embarcadero.com/browse/RSP-42424,

The Correct order is:

begin
  GlobalUseMetal := True; // <-- should appear before Application.Iniialize;
  Application.Initialize;

HTH,

Navid

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×