-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[macOS/iOS] Fix RequestedThemeChanged event #11199
Conversation
When will the changes be available in the .net 6 stable version? |
This will probably not land in .NET 6 as it introduces new APIs and thus breaking changes. This will become available in .NET 8 or if we decide this is crucial in .NET 7 maybe. |
Please at least make this change in .NET 7. This is not a new feature but a crucial fix for developing macOS apps using .NET MAUI. I am currently developing a MAUI application that I intend to ship to macOS only (cross platform to be flexible) and my current experience is that its Dark Mode capabilities are completely unusable without this fix and I would never ship my app in its current state. How could it be better to keep it in its current state "to not break things"? Currently this part of the macOS target is completely broken anyways! 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small possible improvement
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
Outdated
Show resolved
Hide resolved
…ctionRootRenderer.cs Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Changes made. Please re-review.
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
Outdated
Show resolved
Hide resolved
/backport to net7.0 |
Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/4469092013 |
@rmarinho backporting to net7.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix RequestedThemeChanged event on macOS using Shell
Using index info to reconstruct a base tree...
M src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Auto-merging src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix RequestedThemeChanged event on macOS using Shell
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@rmarinho an error occurred while backporting to net7.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
/backport to main |
Started backporting to main: https://github.com/dotnet/maui/actions/runs/4469507099 |
@mattleibow backporting to main failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix RequestedThemeChanged event on macOS using Shell
Using index info to reconstruct a base tree...
M src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
M src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
M src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Auto-merging src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
Auto-merging src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
CONFLICT (content): Merge conflict in src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix RequestedThemeChanged event on macOS using Shell
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@mattleibow an error occurred while backporting to main, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Manuel de la Pena <mandel@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Manuel de la Pena <mandel@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Manuel de la Pena <mandel@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Description of Change
Fix RequestedThemeChanged event using Shell on macOS/iOS.
We use the page controller to detect theme changes thanks to
traitCollectionDidChange
. However, with Shell this doesn't work and the default project template uses Shell. This PR applies changes to detect changes in themes also using Shell.Issues Fixed
Fixes #10055
Fixes #10310
Fixes #11005
Fixes #11119