From f6c6b2e18888ba401e6145eb68d769af7fd2ce0b Mon Sep 17 00:00:00 2001 From: David Ortinau Date: Thu, 25 Sep 2025 01:14:06 +0000 Subject: [PATCH] setting up to debug the titlebar issue with mac catalyst --- maui/samples/Sandbox/App.xaml.cs | 4 +- maui/samples/Sandbox/AppWindow.xaml | 44 +++++++++++++++++++ maui/samples/Sandbox/AppWindow.xaml.cs | 10 +++++ .../SegmentedControl/Views/SegmentLayout.cs | 7 ++- 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 maui/samples/Sandbox/AppWindow.xaml create mode 100644 maui/samples/Sandbox/AppWindow.xaml.cs diff --git a/maui/samples/Sandbox/App.xaml.cs b/maui/samples/Sandbox/App.xaml.cs index 3929e125..7660fb0b 100644 --- a/maui/samples/Sandbox/App.xaml.cs +++ b/maui/samples/Sandbox/App.xaml.cs @@ -9,7 +9,9 @@ public App() protected override Window CreateWindow(IActivationState? activationState) { - return new Window(new AppShell()); + AppWindow window = new AppWindow(); + window.Page = new AppShell(); + return window; } } } diff --git a/maui/samples/Sandbox/AppWindow.xaml b/maui/samples/Sandbox/AppWindow.xaml new file mode 100644 index 00000000..4db164a8 --- /dev/null +++ b/maui/samples/Sandbox/AppWindow.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maui/samples/Sandbox/AppWindow.xaml.cs b/maui/samples/Sandbox/AppWindow.xaml.cs new file mode 100644 index 00000000..6bcb269e --- /dev/null +++ b/maui/samples/Sandbox/AppWindow.xaml.cs @@ -0,0 +1,10 @@ +namespace Syncfusion.Maui.Samples.Sandbox +{ + public partial class AppWindow + { + public AppWindow() + { + InitializeComponent(); + } + } +} diff --git a/maui/src/SegmentedControl/Views/SegmentLayout.cs b/maui/src/SegmentedControl/Views/SegmentLayout.cs index 06608db4..88e5e008 100644 --- a/maui/src/SegmentedControl/Views/SegmentLayout.cs +++ b/maui/src/SegmentedControl/Views/SegmentLayout.cs @@ -42,7 +42,12 @@ internal class SegmentLayout : SfView /// The providing information about the segment items. internal SegmentLayout(ISegmentItemInfo itemInfo) { -#if __IOS__ +#if __IOS__ || MACCATALYST + // Ignore the safe area on iOS and Mac Catalyst so the control is laid out using the + // full bounds provided by its parent. Without this on Mac Catalyst, the initial window + // (non–fullscreen) can report a smaller client area and the segmented control may appear + // shifted upward / clipped beneath the title bar until a subsequent resize or fullscreen + // transition triggers a proper re-measure. (See GitHub issue: SegmentedControl TitleBar layout on macOS.) this.IgnoreSafeArea = true; #endif FlowDirection = Microsoft.Maui.FlowDirection.LeftToRight;