Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace currentAppearance with currentDrawingAppearance on macOS 11+ #1029

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

Saadnajmi
Copy link
Collaborator

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

NSAppearance.current is deprecated. Replace it with NSAppearance.currentDrawing() for macOS 11+.

Note that both can still only be called on the main thread. I have not found a way to access an NSAppearance on a background thread safely.

Changelog

[macOS] [Fixed] - Replace currentAppearance with currentDrawingAppearance on macOS 11+

Test Plan

RN-Tester still works fine in Dark Mode on my macOS 12 machine.

@Saadnajmi Saadnajmi requested a review from a team as a code owner February 18, 2022 21:56
@Saadnajmi Saadnajmi merged commit 88de79a into microsoft:main Feb 18, 2022
@Saadnajmi Saadnajmi deleted the appearance branch February 18, 2022 23:38
Saadnajmi added a commit to Saadnajmi/react-native-macos that referenced this pull request Feb 18, 2022
Saadnajmi added a commit that referenced this pull request Feb 19, 2022
* RCTSwitch: Use NSSwitch instead of NSButton (#924)

* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* [pull] master from microsoft:master (#11)

* Deprecated api (#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>

* Grammar fixes. (#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Saad Najmi <[email protected]>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>

* Use NSSwitch

* remove change from my fork

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>

* DynamicColorMacOS fixes (#1028)

* Use initWithDynamicProvider + Add HC Support

* Update log error

* replace all references to 10.14 (#938)

* Replace currentAppearance with currentDrawingAppearance on macOS 11+ (#1029)

* Manually cherry-pick #1012

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>
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