microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

ExtendsContentIntoTitleBar causes incorrect cursor events, button hover flickering, and click issues

Open DavidRufino opened this issue 7 months ago • 3 comments

Describe the bug

When ExtendsContentIntoTitleBar = true is set on both the main window and any child windows, certain interactions cause incorrect cursor event processing.

Not reproducible in: Microsoft.WindowsAppSDK 1.5.250108004

PoitnerFlickeringIssue

Steps to reproduce the bug

  1. Create a child window with ExtendsContentIntoTitleBar = true
  2. You can reproduce the issue by either minimizing the child window, or by moving the mouse cursor upward — starting from inside the child window, passing through its title bar, and continuing into the main window.
  3. Interact with UI elements in the main window

Expected behavior

Button hover states flickering; Tooltips dont show; MenuFlyoutSubItem closing; Click events not firing correctly;

Screenshots

https://github.com/user-attachments/assets/65a12ab8-909f-47ab-a434-bbd30b56b5bc

NuGet package version

WinUI 3 - Windows App SDK 1.7.1: 1.7.250401001

Windows version

Windows 11 (24H2): Build 26100

Additional context

You can consistently reproduce the issue using the WinUI 3 Gallery app:

  1. Navigate to: Windowing > Multiple windows
  2. Click Create new Window
  3. You can reproduce the issue by either minimizing the child window, or by moving the mouse cursor upward — starting from inside the child window, passing through its title bar, and continuing into the main window.

Observe button hover flickering and click issues in the main window

DavidRufino avatar Apr 25 '25 22:04 DavidRufino

Looks like another incarnation of #10067 that I opened 6 months ago. Eventually a microsoft manager will realise that there is little point adding shiny new features to the sdk if the base line quality is so poor that nobody can release anything using it.

DHancock avatar Apr 26 '25 10:04 DHancock

Our customers have exactly this issue. I can reproduce using the information David supplied. What is worse: clicks/taps do often not register. Customers are complaining that clicking do not take effect.

Please fix this asap! I can reproduce this in version 1.7.1 and 1.7.2

wbokkers avatar May 23 '25 15:05 wbokkers

After researching the issue, I created a workaround.

Basically, if you want a custom title bar, don’t use Window.ExtendsContentIntoTitleBar or Window.SetTitleBar.

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();

        // Not recommended:
        this.ExtendsContentIntoTitleBar = true;
        this.SetTitleBar(AppTitleBar);
    }
}

Use the AppWindow.TitleBar:

var titleBar = this.AppWindow.TitleBar;
titleBar.ExtendsContentIntoTitleBar = true;

Then, disable the default title bar buttons (Minimize, Maximize, Close):

Presenter.IsResizable = true;
Presenter.SetBorderAndTitleBar(true, false);

and handle the drag area and top resize manually:

this._newWndProc = new WndProcDelegate(CustomWndProc);
this._prevWndProc = SetWindowLongPtr(this.HWnd, GWLP_WNDPROC, this._newWndProc);

After applying this approach, I haven’t been able to reproduce the issue anymore.

See the GitHub repository: github.com/DavidRufino/PoitnerFlickering-Workaround

DavidRufino avatar May 26 '25 20:05 DavidRufino

@codendone Any news on this and the related issues? Will it be fixed in the upcoming release?

wbokkers avatar Jul 08 '25 09:07 wbokkers

@wbokkers It looks like there is no fix yet. I passed your question to the bug owner.

codendone avatar Jul 08 '25 20:07 codendone

@codendone Thank you. I don't understand why this hasn't top priority. This issue renders the custom title bar feature useless.

wbokkers avatar Jul 09 '25 04:07 wbokkers

Please fix this issue as it's blocking our release cycles

paulenascut avatar Jul 30 '25 07:07 paulenascut

Any news? Still doesn't seem to be fixed in 1.8 or 1.7 releases.

whiskhub avatar Aug 21 '25 07:08 whiskhub

@codendone Can you please ask your colleague to give this issue high prio? It isn't just a minor bug: the ExtendsContentIntoTitleBar feature is COMPLETELY unusable in any serious app. And it is this way for OVER A YEAR!

wbokkers avatar Aug 21 '25 07:08 wbokkers

This is an update where earlier I reported that setting ExtendsContentIntoTitleBar to True caused blank screen issue. But this is not the cause. The blank screen issue continues even after I set it to False. Still not able to crack this as it doesn't happen on all systems. I have provided some details here: https://github.com/microsoft/microsoft-ui-xaml/discussions/10787

gautambjain avatar Sep 01 '25 09:09 gautambjain

@DavidRufino We have fixed a related flickering issue caused by setting ExtendsContentIntoTitleBar to true. It should be available as part of WindowsAppSDK 1.8- https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.8.250907003. Please test the scenario against this version & let us know if it works. Feel free to re-open this issue if bug still persists.

Hemantxk avatar Sep 10 '25 04:09 Hemantxk

Hi @wbokkers! Did v1.8 fix your issue?

AndrewKeepCoding avatar Oct 01 '25 02:10 AndrewKeepCoding

@AndrewKeepCoding Yes! I confirmed this in a related issue.

wbokkers avatar Oct 01 '25 09:10 wbokkers