Skip to content

Fullscreen reveal bar is draggable and breaks when moved (WindowDrawnDecorations) #21547

Description

@massimopaganigh

Describe the bug

When a Window is in fullscreen mode, the top "reveal bar" (the auto-hide title bar shown by WindowDrawnDecorations when the pointer moves to the top edge) acts as a window drag region. Dragging it starts a window move (BeginMoveDrag) on a fullscreen window: the window is moved off the fullscreen rectangle and the reveal bar / fullscreen chrome ends up in a broken state.

Root cause

In the Fluent theme template, the FullscreenPopover panel is marked with WindowDecorationProperties.ElementRole="TitleBar", i.e. it is registered as a drag region for non-client hit-testing:

src/Avalonia.Themes.Fluent/Controls/WindowDrawnDecorations.xaml

<WindowDrawnDecorationsContent.FullscreenPopover>
    <Panel Height="{TemplateBinding DefaultTitleBarHeight}"
           VerticalAlignment="Top"
           Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}"
           WindowDecorationProperties.ElementRole="TitleBar">

In fullscreen the normal title bar (PART_TitleBar) is collapsed (IsVisible=False), so the popover is the only element with the TitleBar role, and dragging it triggers BeginMoveDrag on the fullscreen window. The reveal bar is a transient overlay (its purpose is to expose the caption buttons to leave fullscreen); it should not behave as a window drag handle.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Window with ExtendClientAreaToDecorationsHint="True".
  2. Put the window into fullscreen (WindowState = WindowState.FullScreen).
  3. Move the pointer to the top edge so the reveal bar appears.
  4. Press and drag on the empty area of the reveal bar (not on a button).

Expected: nothing happens (a fullscreen window should not be movable).
Actual: the window starts moving / leaves the fullscreen rectangle and the reveal bar/chrome breaks.

Expected behavior

The fullscreen reveal bar should not be a window drag region; a fullscreen window should not be movable by dragging it.

Avalonia version

12.0.4

OS

Windows

Additional context

The reveal bar's panel role should be DecorationsElement instead of TitleBar, so it remains part of the non-client chrome but is not a drag handle. The caption buttons inside it keep their own roles (FullScreenButton, CloseButton) and stay functional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions