Skip to content

TabView titlebar drag region not draggable randomly #10391

@FrozenAssassine

Description

@FrozenAssassine

Describe the bug

The TabStripFooter does not properly serve as a titlebar, at some points of resizing the window, it just stops working and breaks.

Steps to reproduce the bug

  1. Create a new WinUI3 Project
  2. Add a TabView with at least enough tabs to make it scrollable:
  3. Add a drag region which serves as the titlebar
<TabView
      x:Name="tabControl"
      Loaded="tabControl_Loaded">
    <TabView.TabStripFooter>
        <Grid x:Name="customDragRegion" HorizontalAlignment="Stretch" Background="Green" VerticalAlignment="Stretch" MinWidth="188" Margin="0,-2,0,0"/>
    </TabView.TabStripFooter>
</TabView>
  1. Set the titlebar in the code behind:
this.ExtendsContentIntoTitleBar = true;

private void tabControl_Loaded(object sender, RoutedEventArgs e)
{
    this.SetTitleBar(customDragRegion);

    for (int i = 0; i < 20; i++)
        tabControl.TabItems.Add(new TabViewItem { Header = "Tab Header!" });
}
  1. You should see a green grid in the window.
  2. Start moving your window by clicking on the green grid. Should work. Now put your window into maximized mode. Moving the window does not work anymore. Putting the window back to normal size, should also not allow moving it. But resizing just a tiny bit fixes everything and moving works again.

Expected behavior

I would expect the window to always be able to get moved around

Screenshots

20250227-0656-34.6436089.mp4

NuGet package version

Windows App SDK 1.6.3: 1.6.250108002

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 24H2 (22621, October 2024 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TitleBarIssues related to custom window title bars.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions