X Tutup
Skip to content

BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions#6334

Merged
lephilousophe merged 2 commits intoscummvm:masterfrom
lephilousophe:macos-no-touchbar
Dec 28, 2024
Merged

BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions#6334
lephilousophe merged 2 commits intoscummvm:masterfrom
lephilousophe:macos-no-touchbar

Conversation

@lephilousophe
Copy link
Member

They do not support it and it fails on invalidateIntrinsicContentSize.

@lephilousophe lephilousophe requested review from criezy and sev- December 23, 2024 19:17
Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@lephilousophe
Copy link
Member Author

Thank you for your review.

Indeed, the define check needed to be modified and it's now done.
I did the nullptr changes in a separate commit to be cleaner.

@lephilousophe
Copy link
Member Author

Merging as the build succeeded.

@lephilousophe lephilousophe merged commit 95c65cd into scummvm:master Dec 28, 2024
@lephilousophe lephilousophe deleted the macos-no-touchbar branch December 28, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup