BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions#6334
BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions#6334lephilousophe merged 2 commits intoscummvm:masterfrom
Conversation
criezy
left a comment
There was a problem hiding this comment.
Looks good.
I was wondering why use NSAppKitVersionNumber10_12_2 rather than NSAppKitVersionNumber10_12 but I see NSTouchBar was introduced in macOS 10.12.2. So it makes sense.
My only small worry if that this code is compiled when using a 10.12+ SDK but I assume that NSAppKitVersionNumber10_12_2 is only defined in 10.12.2+ SDK, and thus that the compilation would fail when using 10.12.0 or 10.12.1 SDK. But I am not even sure it would compile without your change due to the makeTouchBar method using NSToolbar. Could you change the MAC_OS_X_VERSION_10_12 into MAC_OS_X_VERSION_10_12_2 in the precompiled guards at the top of the file to fix this as well?
And while you are at it, since this is an objective-C file, it would be cleaner to use nil rather than nullptr. I noticed a couple of places where the latter is used in that file. Maybe that could be cleanup at the same time.
They do not support it and it fails on invalidateIntrinsicContentSize As the touch bar was introduced in 10.12.2, check the SDK version against this define instead on 10.12.
abac726 to
6953728
Compare
|
Thank you for your review. Indeed, the define check needed to be modified and it's now done. |
|
Merging as the build succeeded. |
They do not support it and it fails on invalidateIntrinsicContentSize.