Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI 3 Window.ExtendsContentIntoTitleBar caption buttons can be clicked when mouse is not over them #7259

Closed
BreeceW opened this issue Jun 19, 2022 · 6 comments
Assignees
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working product-winui3 WinUI 3 issues team-Reach Issue for the Reach team

Comments

@BreeceW
Copy link
Contributor

BreeceW commented Jun 19, 2022

Describe the bug

When a user presses the left mouse button down over a caption button (i.e., Minimize, Restore/Maximize, Close) in the title bar when the title bar has been customized using Window.ExtendsContentIntoTitleBar, the button will still be clicked even if the user has moved their mouse off of the button.

Steps to reproduce the bug

  1. Customize a WinUI 3 window where Window.ExtendsContentIntoTitleBar = true (you can use the WinUI 3 Gallery app as an example)
  2. Hover over the close button (this issue affects minimize and maximize as well), and click the left mouse button down
  3. Move the mouse away from the close button (the close button will still appear in the pressed visual state)
  4. Release the left mouse button
  5. The window will close

Expected behavior

The button should not be clicked if the left mouse button is released when cursor has moved off the caption button. Additionally, the button should not appear in the pressed visual state if the cursor is not over it.

Screenshots

The expected behavior when using the standard title bar:

Good.mp4

The problematic behavior when using Window.ExtendsContentIntoTitleBar:

Bad.mp4

NuGet package version

WinUI 3 - Windows App SDK 1.1.1

Windows app type

  • ☐ UWP
  • 🗹 Win32

Device form factor

Desktop

Windows version

Windows 11 (22H2): Build 22621

Additional context

This is an important usability issue because these caption buttons behave differently from every other Windows caption buttons and has the potential to cause loss of work. If, for instance, a user inadvertently clicks their mouse button down on the close button, the window will close once they release the mouse button, and there is nothing they can do about it. The correct behavior would allow the user to move the cursor off the close button and safely release the mouse button.

Note that this issue only affects Window.ExtendsContentIntoTitleBar and not AppWindowTitleBar.ExtendsContentIntoTitleBar or the default title bar.

@BreeceW BreeceW added the bug Something isn't working label Jun 19, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jun 19, 2022
@krschau krschau added team-Reach Issue for the Reach team area-TitleBar Issues related to custom window title bars. product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels Jun 27, 2022
@krschau
Copy link
Contributor

krschau commented Jun 27, 2022

I can also repro this with the WinUI 3 Controls Gallery.
FYI @pratikone

@everdrone
Copy link

Experiencing this too, is there a fix yet?

@pratikone pratikone self-assigned this Jan 25, 2023
@pratikone
Copy link
Contributor

Thanks for reporting this bug. I am looking into it.

@Gabboxl
Copy link

Gabboxl commented Apr 1, 2023

I'm facing the same problem, any update on this?

Also, the captions controls used when setting Window.ExtendsContentIntoTitleBar = true don't seem to be consistent compared to native windowing ones.

Instead, the caption controls used when setting AppWindowTitleBar.ExtendsContentIntoTitleBar = true with a transparent background with the following code feel very native, just like a UWP app.

AppWindowTitleBar titleBar = AppWindow.TitleBar;

titleBar.ExtendsContentIntoTitleBar = true;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;

@pratikone
Copy link
Contributor

I am working to merge WinUI 3 custom titlebar with Appwindow titlebar in a way that winui 3 custom titlebar apis will internally call appwindow apis. so the behavior will start matching once that happens.

@pratikone
Copy link
Contributor

It has been fixed in Winappsdk 1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working product-winui3 WinUI 3 issues team-Reach Issue for the Reach team
Projects
None yet
Development

No branches or pull requests

5 participants