How to disable the compatibility mode?
lazarus / 33-macOS - Mac OS X
----------------------------------------------------------------------
salvadordf · 2024-09-08 16:24
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!
----------------------------------------------------------------------
Jonas Maebe · 2024-09-08 18:18
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_B
ig_Sur_changes_for_developers#Creating_a_universal_binary_for_aarch64_
and_x86_64 for more information
----------------------------------------------------------------------
salvadordf · 2024-09-09 09:29
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. Thanks anyway!
----------------------------------------------------------------------
Jonas Maebe · 2024-09-09 18:59
Then maybe it's https://developer.apple.com/documentation/bundleresour
ces/information_property_list/nsprefersdisplaysafeareacompatibilitymod
e ? 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
----------------------------------------------------------------------
salvadordf · 2024-09-10 14:16
Thanks again Jonas!
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.
NSPrefersDisplaySafeAreaCompatibilityMode