Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127634 Custom Titlebars
  3. QTBUG-133265

Investigate performance and potential sharp corners in Windows custom titlebar implementation using subwindow

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • None
    • Windows

    Description

      vestbo I'm not sure if that is a good idea. That is most likely not compatible with `WS_EX_NOREDIRECTIONBITMAP`, which is essential for people who want to have transparent `QQuickWindow` with the RHI D3D11/D3D12 backend (and also for people who don't want to have redirection surface for other reasons, including performance gain).
      Edit Delete
      vestbo added a comment - 1 hour ago

      That is most likely not compatible with `WS_EX_NOREDIRECTIONBITMAP`, which is essential for people who want to have transparent `QQuickWindow` with the RHI D3D11/D3D12 backend (and also for people who don't want to have redirection surface for other reasons, including performance gain).

      fuzun Could you file a spin-off issue from this one where you describe this in more detail, and ideally attach a sample that shows the problem? CC wladimir.leuschner Thanks! 

       
      Edit Delete
       added a comment  20 minutes ago  edited

      Could you file a spin-off issue from this one where you describe this in more detail, and ideally attach a sample that shows the problem?

      vestbo  I have not yet confirmed the issue, and unfortunately I'm not sure when I can do that. However, checking it should be trivial, simply have the environment variable `QT_QPA_DISABLE_REDIRECTION_SURFACE` set before the main window is created (`QWindow::create()`) (and disable it afterwards). Note that standard `QWidget` windows don't use D3D as far as I know, so `QQuickWindow` should be used to check.

      When `WS_EX_NOREDIRECTIONBITMAP` is used, `QMenu` (a `QWidget` window) are not displayed, for example. That's why I assume the same problematic scenario with what is done currently.

      At the same time, this is only for the problem itself. In ideal case `QPainter` should not be unconditionally used regardless, and there should not be a child transparent window at the same time.

      Child transparent window needs to be layered and that is bad for performance. I think `QWindow` surface type should be checked, and `QRhi` / `QBackingStore` (`QPainter`) should be used based on the surface type to draw on top of the window.

      `QWindow` has `QWindow::paintEvent(QPaintEvent *ev)`, and `QQuickWindow` has `QQuickWindow::afterRenderPassRecording()`. It seems that it should be possible to have overlay (which can be transparent) this way.
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            wladimir.leuschner Wladimir Leuschner
            vestbo Tor Arne Vestbø
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes