From f3957aa0669748a1f94e4e9e59bcc6b6777486d5 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Thu, 19 May 2022 22:59:21 -0500 Subject: [PATCH] Update src/Core/src/Platform/Tizen/WindowExtensions.cs Co-authored-by: Kangho Hur --- src/Core/src/Platform/Tizen/WindowExtensions.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Core/src/Platform/Tizen/WindowExtensions.cs b/src/Core/src/Platform/Tizen/WindowExtensions.cs index c9a3fc882727..4e8e5b86bdd2 100644 --- a/src/Core/src/Platform/Tizen/WindowExtensions.cs +++ b/src/Core/src/Platform/Tizen/WindowExtensions.cs @@ -111,14 +111,17 @@ static void OnBackButtonPressed(Window window) s_windowCloseRequestHandler[window].Invoke(); } - internal static Devices.DisplayOrientation GetOrientation(this IWindow window) => - window.Handler?.MauiContext?.GetPlatformWindow()?.Rotation switch + internal static Devices.DisplayOrientation GetOrientation(this IWindow window) + { + bool isTV = Elementary.GetProfile() == "tv"; + return window.Handler?.MauiContext?.GetPlatformWindow()?.Rotation switch { - 0 => Devices.DisplayOrientation.Portrait, - 90 => Devices.DisplayOrientation.Landscape, - 180 => Devices.DisplayOrientation.Portrait, - 270 => Devices.DisplayOrientation.Landscape, + 0 => isTV ? Devices.DisplayOrientation.Landscape : Devices.DisplayOrientation.Portrait, + 90 => isTV ? Devices.DisplayOrientation.Portrait : Devices.DisplayOrientation.Landscape, + 180 => isTV ? Devices.DisplayOrientation.Landscape : Devices.DisplayOrientation.Portrait, + 270 => isTV ? Devices.DisplayOrientation.Portrait : Devices.DisplayOrientation.Landscape, _ => Devices.DisplayOrientation.Unknown }; + } } } \ No newline at end of file