[Linux CentOS Stream 9] grabWindow doesn't work with Qt 6.4.2 on CentOS Stream 9 if graphics driver are not installed
-
The grabWindow() method doesn't work on CentOS stream 9 if graphics driver are not installed.
I tried on a machine with CentOS Stream9 with graphics driver (NVidia) installed and it works perfectly fine. However, I am trying it on a VM and the size of pixmap returned through grabWindow() call is 0.
The sibling geometry returns the correct value.
Also tried passing QWidget::winId() to the grabWindow method but still the same result.Any input related to this will be appreciated.
This is the sample code I tried to get the screenshot of multiple monitors attached
void Widget::on_pushButton_clicked() { QScreen *screen = QGuiApplication::primaryScreen(); if(screen) { QImage m_image = QImage(screen->virtualGeometry().width(), screen->virtualGeometry().height(), QImage::Format_ARGB32_Premultiplied); QPainter painter(&m_image); for(QScreen* sibling : screen->virtualSiblings()) { qDebug() << "sibling geometry:" << sibling->geometry(); QPixmap pix = sibling->grabWindow(); qDebug() << "pix:" << pix.size(); painter.drawImage(sibling->geometry().x(), sibling->geometry().y(), pix.toImage()); } } }
-
What graphics subsystem do you use in the VM? Wayland? X11? Something else? What graphics driver is used in the VM (depends on what virtualization software you're using)?
-
I am using VMWare Player
VGA compatible controller: VMware SVGA II Adapter
However, I get this issue on an actual hardware as well if graphics driver are not installed.
Tried on an actual hardware with Radeon RX 6600Graphic Card: AMD Radeon RX 6600 (radeonsi, navi23, LLVM 17.0.6, DRM 3.54, 5.14.0-446.el9.x86_64)(AMD)
Driver: 4.6 (Compatibility Profile) Mesa 23.3.3
Using X11 -
Are VMWare tools installed?
I have taken screenshots from VMs many times, using all kinds of virtualization software from openBox, to Parallels and VMWare.
If memory serves well, VMWare really wants its tools installed for drivers to work correctly. -
I am just using VM for testing.. As I mentioned, I also have the issue on actual hardware machines when graphics drivers are not installed. I tried on a workstation with the following configuration
Graphic Card: AMD Radeon RX 6600 (radeonsi, navi23, LLVM 17.0.6, DRM 3.54, 5.14.0-446.el9.x86_64)(AMD)
Driver: 4.6 (Compatibility Profile) Mesa 23.3.3As the graphics driver is not installed, grabWindow() command fails and returns a pixmap of size 0
-
@nitingera said in [Linux CentOS Stream 9] grabWindow doesn't work with Qt 6.4.2 on CentOS Stream 9 if graphics driver are not installed:
As the graphics driver is not installed, grabWindow() command fails and returns a pixmap of size 0
Then install the graphics driver...