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

QScreen::grabWindow() wrong area/quality when grabbing hi-DPI external monitor.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.3.2, 5.4.2, 5.5.0
    • QPA
    • None
    • Macbook Air 11", OS X 10.10
    • macOS

      Using these lines to capture the contents of an external screen (QScreen)

      const QRect geometry = screen->geometry();
      pixmap = screen->grabWindow(desktop->winId(),
               geometry.x(), geometry.y(),
               geometry.width(), geometry.height()
               );
      

      the geometry here is e.g. QRect(-960,0 960x540) for an external monitor positioned to the left of the main screen.

      If I move the external monitor to the right of the main screen under System Preferences -> Displays, the capture works as expected. It also works as expected when making the external monitor primary, regardless of which side it's on. Internal monitor on left hand side on (now primary) external monitor gives a geometry of QRect(-1366,0 1366x768)

      Possibly related: QTBUG-44422

        For Gerrit Dashboard: QTBUG-47643
        # Subject Branch Project Status CR V

            sorvig Morten Sørvig
            xim Morten Neergaard
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes