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

grabWindow() returns pixmap which is NULL on WSL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.7.0
    • QPA: Wayland
    • Linux/Wayland

    Description

      On WSL, screen.grabWindow() returns a NULL pixmap. Here's the failing code in Python:

      from PySide6.QtWidgets import QApplication
      
      screen = QApplication().primaryScreen()
      print(screen.manufacturer())
      print(screen.model())
      print(screen.name())
      print(screen.geometry())
      print(screen.availableGeometry())
      print(screen.virtualGeometry())
      print(screen.orientation())
      print(screen.depth())
      print(screen.devicePixelRatio())
      print(screen.grabWindow().isNull())
      

      Output:

      python bug.py 
      weston
      rdp
      rdp-0
      PySide6.QtCore.QRect(1680, 0, 1920, 1080)
      PySide6.QtCore.QRect(1680, 0, 1920, 1080)
      PySide6.QtCore.QRect(0, 0, 3600, 1080)
      ScreenOrientation.LandscapeOrientation
      32
      1.0
      True
      

      The same code works fine in Windows:

      Philips Consumer Electronics Company
      273ELH
      273ELH
      PySide6.QtCore.QRect(0, 0, 1920, 1080)
      PySide6.QtCore.QRect(0, 0, 1920, 1032)
      PySide6.QtCore.QRect(-1680, 0, 3600, 1080)
      ScreenOrientation.LandscapeOrientation
      32
      1.0
      False
      

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              bers bers bers
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes