Git Product home page Git Product logo

Comments (2)

DarranRowe avatar DarranRowe commented on May 26, 2024 1

AFAIK, this is expected behaviour.
The way the custom title bar works is that it essentially makes the title bar region part of the client area of the window. If you dig deep enough into the implementation, you should find that it is implemented around DwmExtendFrameIntoClientArea.
For this custom title bar to work as a title bar, since it is part of the window's client area, the custom title bar must intercept input and make that input behave like the title bar. This is why InputNonClientPointerSource exists.
The other big issue here is that WinUI 3 doesn't draw using child windows. It uses its own implementation of the Visual Layer, and this is based upon Windows' DirectComposition. Because of this, you should expect the model to be something close to the DirectComposition model. From what I have seen, WinUI 3 uses the bottom layer for all regular, non external content and then the top layer for effects.
But this is important. Because all WinUI 3 content is just bitmaps drawn to the lower layer, there is no way for any of the WinUI 3 content drawn to the main window to get above the input interception of the main window. This means that if any stray WinUI 3 content gets drawn into the area defined as the title bar then you just cannot interact with it normally.

So the real bug here isn't that anything on the title bar is considered the title bar, but instead, WinUI 3 placed content at the top of the window without checking if there was a custom title bar. It can't just check if it is within the bounds of the client area, since the custom title bar is seen as part of the window's client area.

from microsoft-ui-xaml.

pratikone avatar pratikone commented on May 26, 2024 1

This is an expected behavior. This is how titlebar apis work. They create a draggable region wherever you define and that acts like a titlebar region. You can infact have multiple.

Coming back to your problem, since you are already using low level non client apis, you can just disable them (using ClearRegionRect api) whenever NavigationView is open and setRegionRects when it is closed.
Infact, I am using the same method internally whenever ContentDialog is displayed. Benefit of source availability, I can share the exact place . https://github.com/microsoft/microsoft-ui-xaml/blob/winui3/release/1.5-stable/dxaml/xcp/components/WindowChrome/CWindowChrome.cpp#L370

In future, there can be better ways to solve it. For now, this is the best way. Since, it is by design, I am closing the bug. Feel free to comment if you have more related questions on it.

from microsoft-ui-xaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.