1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00

UIViewComponentPeer: Call setNeedsUpdateOfSupportedInterfaceOrientations on orientation change

This commit is contained in:
reuk 2023-02-08 14:09:31 +00:00
parent d037d45e3b
commit eecb8ad995

View file

@ -2192,8 +2192,14 @@ void Desktop::allowedOrientationsChanged()
{
if ([scene isKindOfClass: [UIWindowScene class]])
{
[static_cast<UIWindowScene*> (scene) requestGeometryUpdateWithPreferences: preferences.get()
errorHandler: ^([[maybe_unused]] NSError* error)
auto* windowScene = static_cast<UIWindowScene*> (scene);
for (UIWindow* window in [windowScene windows])
if (auto* vc = [window rootViewController])
[vc setNeedsUpdateOfSupportedInterfaceOrientations];
[windowScene requestGeometryUpdateWithPreferences: preferences.get()
errorHandler: ^([[maybe_unused]] NSError* error)
{
// Failed to set the new set of supported orientations.
// You may have hit this assertion because you're trying to restrict the supported orientations