diff --git a/native/Avalonia.Native/src/OSX/WindowImpl.mm b/native/Avalonia.Native/src/OSX/WindowImpl.mm index 104611eabc0..925880534ad 100644 --- a/native/Avalonia.Native/src/OSX/WindowImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowImpl.mm @@ -281,10 +281,13 @@ case SystemDecorationsFull: [Window setHasShadow:YES]; - [Window setTitleVisibility:NSWindowTitleVisible]; - [Window setTitlebarAppearsTransparent:NO]; [Window setTitle:_lastTitle]; + if (!_isClientAreaExtended) { + [Window setTitleVisibility:NSWindowTitleVisible]; + [Window setTitlebarAppearsTransparent:NO]; + } + if (currentWindowState == Maximized) { auto newFrame = [Window contentRectForFrameRect:[Window frame]].size; @@ -611,7 +614,8 @@ } bool wantsChrome = (_extendClientHints & AvnSystemChrome) || (_extendClientHints & AvnPreferSystemChrome); - bool hasTrafficLights = _isClientAreaExtended ? wantsChrome : _decorations == SystemDecorationsFull; + bool hasTrafficLights = (_decorations == SystemDecorationsFull) && + (_isClientAreaExtended ? wantsChrome : true); NSButton* closeButton = [Window standardWindowButton:NSWindowCloseButton]; NSButton* miniaturizeButton = [Window standardWindowButton:NSWindowMiniaturizeButton]; diff --git a/samples/IntegrationTestApp/MainWindow.axaml b/samples/IntegrationTestApp/MainWindow.axaml index d4a96c5f175..bd840c03a7e 100644 --- a/samples/IntegrationTestApp/MainWindow.axaml +++ b/samples/IntegrationTestApp/MainWindow.axaml @@ -151,6 +151,12 @@ Maximized FullScreen + + None + BorderOnly + Full + + ExtendClientAreaToDecorationsHint Can Resize diff --git a/samples/IntegrationTestApp/MainWindow.axaml.cs b/samples/IntegrationTestApp/MainWindow.axaml.cs index 19eb1d64b0f..e9b86b3bdd3 100644 --- a/samples/IntegrationTestApp/MainWindow.axaml.cs +++ b/samples/IntegrationTestApp/MainWindow.axaml.cs @@ -68,6 +68,8 @@ private void ShowWindow() var locationComboBox = this.GetControl("ShowWindowLocation"); var stateComboBox = this.GetControl("ShowWindowState"); var size = !string.IsNullOrWhiteSpace(sizeTextBox.Text) ? Size.Parse(sizeTextBox.Text) : (Size?)null; + var systemDecorations = this.GetControl("ShowWindowSystemDecorations"); + var extendClientArea = this.GetControl("ShowWindowExtendClientAreaToDecorationsHint"); var canResizeCheckBox = this.GetControl("ShowWindowCanResize"); var owner = (Window)this.GetVisualRoot()!; @@ -95,6 +97,8 @@ private void ShowWindow() } sizeTextBox.Text = string.Empty; + window.ExtendClientAreaToDecorationsHint = extendClientArea.IsChecked ?? false; + window.SystemDecorations = (SystemDecorations)systemDecorations.SelectedIndex; window.WindowState = (WindowState)stateComboBox.SelectedIndex; switch (modeComboBox.SelectedIndex) diff --git a/samples/IntegrationTestApp/ShowWindowTest.axaml b/samples/IntegrationTestApp/ShowWindowTest.axaml index bd6910dd4de..720ff6c344d 100644 --- a/samples/IntegrationTestApp/ShowWindowTest.axaml +++ b/samples/IntegrationTestApp/ShowWindowTest.axaml @@ -6,7 +6,7 @@ x:DataType="Window" Title="Show Window Test"> - + @@ -35,13 +35,25 @@ FullScreen - - + + + None + BorderOnly + Full + + + + ExtendClientAreaToDecorationsHint + + + + -