iMac M1 which build architecture to use


I bought an iMac with M1 processor, which Xojo build architecture should I use ?

using x86 64-bit the application behaves as before.
If I use ARM 64-bit shifts all window data to the top, about 5mm and leaves the 5mm gap at the bottom of the window.

What computer will run your application ?

iMac M1 computers only

So noone with an intel machine will run your app?

that’s right

what’s the difference, who is using which architecture ?

I’m not sure, havent used an M1 yet, but if you compile for ARM only, you are limiting your user base to arm only macs.

The again, I know nothing about your user base, so just ignore me :slight_smile:

You pick ARM for Apple Silicon on your M1.

You may pick Universal for apps to give to other macOS users.

if I use ARM for my iMac M1, the window display does not work properly.
As I mentioned it already, it moves all window contents more to the top and creates a maybe 5mm gap at the bottom of the window!

this rectangle has been places at the bottom of the screen, for testing only !!
Screen Shot 2021-11-01 at 17.40.22

You must be doing something in your app to cause such a behaviour. Can you make an example?

here are some screenshots from my test app

all you need is a window, a toolbar and a rectangle at the bottom.
It only happens if using a toolbar, with ARM 64-bit it handles the toolbar differently, it is smaller.

what happens in the test app, AFTER resizing the window of the X68 64-bit version, it displayed perfectly !!

it’s not a big deal if you know why it happens, but to find the problem, that took me a while with a bit of luck.

In my real application it happened exactly the other way round. X68 displayed ok but ARM version did not, strange !!

I’m running Xojo 2020.2 on an iMax M1

Running ARM64

running X68, → toolbar is different, much higher, that’s probably the reason

With ARM you are linking against the macOS 11 SDK, which uses the unified toolbar by default. With x86 you are linked against an older SDK which uses the older toolbar style. Updating Xojo will have both using the same newer SDK, if I recall correctly, but that would mean your x86 version becomes wrong too. There is a declare somewhere to have the older non-unified style used, even in the newer SDK versions. I just don’t know it off the top of my head.

For M1, copiling as Universal generate a far larger “file” (in fact, two applications in the same container: one for Intel and one for M1).

So, compile for M1 if you only need M1 applications.

Set your design accordingly (and forget the differences with Intel).

At last, one day, Intel compile will disappear (because of no more Intel Mac Computers).

yes Emilie,
that’s the obvious solution, I just did not know why it happened,

thanks to all for your help

You mean [NSWindow toolbarStyle]

Which can be changed after build by App Wrapper. Its how App Wrapper was able to use the Unified toolbar style before Xojo increased SDK to macOS 11.

Does changing the macOS version linked to change the minimum system version that the app can run on? I’d like to use a unified toolbar, but not at the exclusion of users who are still running Catalina and older.

I offer the unified toolbar as option for BS and Monterey. On older macOS versions my app has the standard toolbar.

Edit: with code

'show toolbar depending on prefs
dim theNSWindow as NSWindowMBS = self.NSWindowMBS
#Pragma BreakOnExceptions False
  if Globals.thePrefs.GetPrefBoolean("compactToolbar") then
    theNSWindow.toolbarStyle = NSWindowMBS.NSWindowToolbarStyleUnified
    theNSWindow.toolbarStyle = NSWindowMBS.NSWindowToolbarStyleExpanded
  end if
catch err as NSExceptionMBS
end try
1 Like

What would all do without MBS? This is great, thank you!

1 Like