Skip to content

Mac Catalyst window separator line being moved under certain circumstances #26650

@beeradmoore

Description

@beeradmoore

Description

So this one is odd and took me some time to narrow down in a repro project to narrow it down.

The short of it is there is a horizontal line on a window that separates the window title area (where close/max/min buttons are) and the content of a ContentPage. Putting a CollectionView (and seems ONLY a CollectionView) on a ContentPage that replaces the default Window.Page property this horizontal line will be moved to the top of the CollectionView.

Demo project has the following main changes from a file -> new project

  • Disabled all styles
  • Deleted shell

Using Mac Catalyst desktop idom (UIDeviceFamily=6) does not change the issue.

App class will create a new Window, this Window sets its Page to MainPage via its constructor. MainPage has a single button which replaces the Page property of the root window with a new TestPage object with the following code.

App.Current.Windows[0].Page = new TestPage();

NOTE: Using new TestPage() instead of new MainPage() when creating the Window in App causes the issue to not occur. It only happens if we replace the Page of our root Window.

Inside the TestPage we have the following layout.

<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,*">
    <VerticalStackLayout Grid.Column="0" Grid.Row="0">
        <Label Text="Test Label" FontSize="22" />
    </VerticalStackLayout>

    <Grid Grid.Row="1" Grid.Column="1" RowDefinitions="44,*">
        <BoxView Grid.Row="0" BackgroundColor="Red" />
        <CollectionView Grid.Row="1" BackgroundColor="Blue" />
    </Grid>
</Grid>

Up the top we have a VerticalStackLayout and a Label. We just need something to size content above the CollectionView so it can be seen. Under that we have a Grid which has a red BoxView followed by a blue CollectionView.

Changing the first RowDefinitions to be anything but Auto for the first row (eg, * or 50) will cause the issue to not occur. I feel this has something to do with a certain measure not happening.

Changing CollectionView to another type (I tried a ListView) means the problem will also not occur.

The horizontal line in question will appear between the red and blew areas of the page. Here is an example.

Image

If you resize the window, or do any of the things mentioned above for the issue to not occur then the page will look like this.

Image

An interesting observation I alluded to before is that the horizontal line is the separator from the window title bar. Here is a gif of me resizing, so you can see it jump in real time.

(EDIT: macOS 15.4 resizing no longer caused the horizontal line to move)

Image

I tested this on Windows, iOS, and Android, none of them showed the issue.

Steps to Reproduce

  1. See the repro project
  2. Run on Mac Catalyst
  3. Click the button to go to the test page
  4. Observe the window separator line not where it should be

Link to public reproduction project repository

https://github.com/beeradmoore/maui-issue-CollectionViewHorizontalLine

Version with bug

9.0.21 SR2.1
(EDIT: Updated sample to 9.0.50, problem still persists)

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

macOS Sequoia 15.2

EDIT: macOS 15.4 no longer has the line adjust go back to were it should be resizing the window.

Did you find any workaround?

Manually set the height of the content above a CollectionView. But considering this is the problem there will be other problems where that won't be acceptable.

Relevant log output

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions