Skip to content
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: Interaction between ExtendClientAreaToDecorationsHint and SystemDecorations is broken #10650

Closed
grokys opened this issue Mar 13, 2023 · 0 comments · Fixed by #10677
Closed

Comments

@grokys
Copy link
Member

grokys commented Mar 13, 2023

Describe the bug

When setting both ExtendClientAreaToDecorationsHint and SystemDecorations on a Window on macOS, the Window's visual state may be incorrect. There are 2 bugs I've found so far.

To Reproduce no.1
Steps to reproduce the behavior:

  1. Edit Sandbox's MainWindow:
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
        x:Class="Sandbox.MainWindow"
        Title="Hello"
        ExtendClientAreaToDecorationsHint="True">
  <CheckBox Name="sysdec">System decorations</CheckBox>
</Window>
public MainWindow()
{
    this.InitializeComponent();
    this.AttachDevTools();

    var sysdec = this.GetControl<CheckBox>("sysdec");
    sysdec.IsChecked = SystemDecorations == SystemDecorations.Full;
    sysdec.IsCheckedChanged += (s, e) =>
        SystemDecorations = sysdec.IsChecked == true ? SystemDecorations.Full : SystemDecorations.None;
}
  1. Show the window. Observe the no title bar is shown
  2. Toggle the checkbox off and back on, such that SystemDecorations == Full (the original value)
  3. Title bar is now displayed

To Reproduce no.2

  1. Show a window with SystemDecorations="BorderOnly" and ExtendClientAreaToDecorationsHint="True"
  2. The window will be shown with a disabled close button, which is incorrect

Expected behavior

For repro no.1: the title bar should not be visible once the checkbox is toggled
For repro no.2: The window buttons should all be hidden

Desktop (please complete the following information):

  • OS: macOS
  • Version: master and stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant