Recent

Author Topic: How to disable the compatibility mode?  (Read 816 times)

salvadordf

  • Jr. Member
  • **
  • Posts: 51
    • BriskBard
How to disable the compatibility mode?
« on: September 08, 2024, 06:24:18 pm »
Hi,

A user reported that a CEF4Delphi browser was crashing in macOS 14 and after some investigations I saw that the application was running in "compatibility mode".

Chromium is checking that the OS version is valid and the 10.16 version for the compatibility mode is specifically not allowed.

Is there a project setting, compiler switch or an option in the info.plist file to disable this mode?

Thanks!
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1066
Re: How to disable the compatibility mode?
« Reply #1 on: September 08, 2024, 08:18:40 pm »
I believe compatibility mode means that an Intel binary is being emulated on an ARM-based Mac (M1, M2, ...). The solution would be to compile your application for ARM64 (or for both Intel and ARM64, and then make a universal binary). See https://wiki.freepascal.org/macOS_Big_Sur_changes_for_developers#Creating_a_universal_binary_for_aarch64_and_x86_64 for more information

salvadordf

  • Jr. Member
  • **
  • Posts: 51
    • BriskBard
Re: How to disable the compatibility mode?
« Reply #2 on: September 09, 2024, 11:29:02 am »
Thanks!

I forgot to say that macOS Sonoma is installed on an Intel CPU and Lazarus has the same target.

Edit : Digging a little bit deeper I found that Lazarus apps are built with a minimum macOS version set to 10.8. Using the -WM11.0 custom option in the project is enough to avoid the compatibility mode in Sonoma.  :D  Thanks anyway!
« Last Edit: September 09, 2024, 12:26:13 pm by salvadordf »
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1066
Re: How to disable the compatibility mode?
« Reply #3 on: September 09, 2024, 08:59:30 pm »
Then maybe it's https://developer.apple.com/documentation/bundleresources/information_property_list/nsprefersdisplaysafeareacompatibilitymode ? According to that page, there should be a checkbox on the application bundle's Get Info dialog box to toggle this compatibility mode.

Edit: actually, as a developer you'd probably use the NSPrefersDisplaySafeAreaCompatibilityMode key in the info.plist
« Last Edit: September 09, 2024, 09:54:37 pm by Jonas Maebe »

salvadordf

  • Jr. Member
  • **
  • Posts: 51
    • BriskBard
Re: How to disable the compatibility mode?
« Reply #4 on: September 10, 2024, 04:16:38 pm »
Thanks again Jonas!  :D

Edit : Tried the NSPrefersDisplaySafeAreaCompatibilityMode key but the test app reported an OS version 10.16 (compatibility mode).
Perhaps that key is only used in macs with a camera.

   <key>NSPrefersDisplaySafeAreaCompatibilityMode</key>
   <false/>
« Last Edit: September 10, 2024, 04:51:53 pm by salvadordf »
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

 

TinyPortal © 2005-2018