Skip to content

[12] ExtendClientAreaToDecorationsHint behavior of decorations is broken for Windows #21167

Closed

Description

@drweb86

Describe the bug

Window Title is shown there, in V11 it was not shown when ExtendClientAreaToDecorationsHint is true.
When Title is shown, it lays above the Menu. Should be hidden.
When Title is set to string.Empty, then in task bar application window has no title.
Menu is not reachable by mouse anymore. Double clicks Expand Unexpand the window.

To Reproduce

  <DockPanel>
	  <DockPanel DockPanel.Dock="Top">
		  <!-- Menu Bar -->
		  <Menu DockPanel.Dock="Left">
			  <MenuItem x:Name="AboutMenuItem"
	              Header="{Binding HeaderInformation}"
			      Foreground="White"
                  Classes="MainMenuHeader">
				  <MenuItem.Icon>
					  <Image Source="../Assets/App.png" />
				  </MenuItem.Icon>
				  <MenuItem.Items>
					  <MenuItem Header="{local:Localize Menu_WebSite}"
								Command="{Binding OpenWebsiteCommand}">
						  <MenuItem.Icon>
							  <Image Source="../Assets/App.png" />
						  </MenuItem.Icon>
					  </MenuItem>
					  <MenuItem Header="{local:Localize Menu_License}" Command="{Binding OpenLicenseCommand}" />
				  </MenuItem.Items>
			  </MenuItem>

I pushed it to https://github.com/drweb86/annotator .

Expected behavior

Support main menu natively on title.

Avalonia version

12.0

OS

Windows

Additional context

No response

Activity

  1. drweb86 commented on Apr 12, 2026

    @drweb86
    Author

    Thanks

    <Menu DockPanel.Dock="Left" WindowDecorationProperties.ElementRole="DecorationsElement">
    

    solved issue with mouse click. Now its possible to click menu which is in the bar.

    However Window.Title overlaps with menu and its needed for task bar.

  2. anewton commented on Apr 12, 2026

    @anewton

    Just posted a similar question in Discussions. This does look like a bug since ExtendClientAreaToDecorationsHint="True" also breaks TransparencyLevelHint. Discussions #21170

  3. MrJul commented on Apr 13, 2026

    @MrJul
    Member

    I've opened #21177, with it the ElementRole on non-decorations won't be necessary anymore for hit testing.

    To hide the title bar's text, use the following style:

    <Style Selector="WindowDrawnDecorations /template/ Panel#PART_TitleTextPanel > TextBlock">
      <Setter Property="IsVisible" Value="False" />
    </Style>
  4. MrJul commented on Apr 13, 2026

    @MrJul
    Member

    Opened a proposal to more easily configure which parts of the title bar are displayed: #21178

  5. drweb86 commented on Apr 13, 2026

    @drweb86
    Author

    So far migration code look like this. I'll post it for next people having also such windows and trying to migrate.

    <Window  ... Title="{local:Localize Window_Title}">
    	<Window.Styles>
    		**<Style Selector="WindowDrawnDecorations /template/ Panel#PART_TitleTextPanel > TextBlock">
    			<Setter Property="IsVisible" Value="{Binding !$parent[Window].ExtendClientAreaToDecorationsHint}" />
    		</Style>**
    	</Window.Styles>
    
      <DockPanel>
    	  <DockPanel DockPanel.Dock="Top">
    		  <!-- Menu Bar -->
    		  <Menu DockPanel.Dock="Left" **WindowDecorationProperties.ElementRole="DecorationsElement"**>
    
  6. drweb86 commented on Apr 13, 2026

    @drweb86
    Author

    Thanks @MrJul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions