Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72818

Damage of window decorations' right and bottom edges are outside the surface

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      34e03bf56cb080f3fae7dd31f0eb1d72e3bb518c (qt/qtwayland/5.12)

      Description

      const QImage &QWaylandAbstractDecoration::contentImage()
      {
          Q_D(QWaylandAbstractDecoration);
          if (d->m_isDirty) {
              //Update the decoration backingstore
      
              const int scale = waylandWindow()->scale();
              const QSize imageSize = window()->frameGeometry().size() * scale;
      #ifdef Q_OS_SYLIXOS  // This code should be optimized, it not only for porting SylixOS.
              if ((d->m_decorationContentImage.format() != QImage::Format_ARGB32_Premultiplied) || 
                  (d->m_decorationContentImage.size()   != imageSize)) {
                  d->m_decorationContentImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied);
                  d->m_decorationContentImage.setDevicePixelRatio(scale);
                  d->m_decorationContentImage.fill(Qt::transparent);
                  this->paint(&d->m_decorationContentImage);
                  // // Should the parameter here be like this? Not frameGeometry() but geometry()!
                  QRegion damage = marginsRegion(window()->geometry().size(), window()->frameMargins());
                  for (QRect r : damage)
                      waylandWindow()->damage(r);
              }
      #else
              d->m_decorationContentImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied);
              d->m_decorationContentImage.setDevicePixelRatio(scale);
              d->m_decorationContentImage.fill(Qt::transparent);
              this->paint(&d->m_decorationContentImage);
      
              QRegion damage = marginsRegion(window()->frameGeometry().size(), window()->frameMargins());
              for (QRect r : damage)
                  waylandWindow()->damage(r);
      #endif
              d->m_isDirty = false;
          }
      
          return d->m_decorationContentImage;
      }
      

      file: /qt5/qtwayland/src/client/qwaylandabstractdecoration.cpp
      describe: Whether the parameter of marginsRegion is should be the original size and margin´╝ü

      ---------------------------------------twice---------------------------------------------------
      The latest code changed the calculation area to the wrong one.
      // The first parameter should be geometry without margins.
      QRegion damage = marginsRegion(waylandWindow()>surfaceSize(), waylandWindow()>frameMargins());
      for (QRect r : damage)
      waylandWindow()->damage(r);

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              johanhelsing Johan Helsing
              Reporter:
              xiaoyan xiao yan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes