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

grabWindow() does not capture entire second screen

    XMLWordPrintable

Details

    • Windows

    Description

       

      grabWindow() is unable to capture entire screen in dual screen setup and if second screen happen to be 4k when capturing as follows:

      QRect desktopGeo = QApplication::primaryScreen()->virtualGeometry();
        QPixmap screenshotFullscreen = QApplication::primaryScreen()->grabWindow(0, 
             desktopGeo.x(), desktopGeo.y(), desktopGeo.width(), desktopGeo.height());
      

      The resulting image from grabWindow lacks the 25% on the second screen. As it seems that the devicePixelRatio is ignored by grabWindow function.

      Setup:
      First screen QRect(0,0 1920x1080) / devicePixelRatio: 1
      Second screen QRect(1920,-764 3072x1728) / devicePixelRatio: 1.25

      Attached small code reproduces this.

      This works good with Qt5.15.11 and Qt6.2.4.

      Attachments

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

        Activity

          People

            inho Inho Lee
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes