ExtendsContentIntoTitleBar causes incorrect cursor events, button hover flickering, and click issues
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
Steps to reproduce the bug
- Create a child window with ExtendsContentIntoTitleBar = true
- 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.
- 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:
- Navigate to: Windowing > Multiple windows
- Click Create new Window
- 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
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.
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
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
@codendone Any news on this and the related issues? Will it be fixed in the upcoming release?
@wbokkers It looks like there is no fix yet. I passed your question to the bug owner.
@codendone Thank you. I don't understand why this hasn't top priority. This issue renders the custom title bar feature useless.
Please fix this issue as it's blocking our release cycles
Any news? Still doesn't seem to be fixed in 1.8 or 1.7 releases.
@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!
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
@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.
Hi @wbokkers! Did v1.8 fix your issue?
@AndrewKeepCoding Yes! I confirmed this in a related issue.