linux - Qt + XCompositeRender problem -


I want to use XComposite and XRender in the window in QWidget (or QPixmap) the contents of the window. The problem I am facing is that I can not provide the picture in QWidget The following code is written using the following tutorial: Window ID is hardcoded, so use any other window id The QWidget window that opens does not display the contents of the original window, but the only thing that shows the blank gray rectangle is the same thing if I use QCixmaps , There is only black rectangle and nothing else is enabled XRender support.

What am I missing here?

  int main (int argc, char * argv []) {Q application application (argc, argv); Display * dpy = XOpenDisplay (getenv ("DISPLAY")); Window window = 20 9 7154; XCompositeRedirectWindow (DP, Window, Composite Redirect Manual); XWindowAttributes attr; XGetWindowAttributes (dpy, windows, and atri); XRenderPictFormat * Format = XRenderFindVisualFormat (dpy, attr.visual); Bool hasAlpha = (Format-> Type == PictType Direct & amp; Format-> Direct. Alpha Mask); Int x = attr.x; Int y = attr.y; Int width = attr.width; Int height = attr.height; QDebug () & lt; & Lt; Halafa & lt; & Lt; X & LT; & Lt; Y & lt; & Lt; Width & lt; & Lt; Height; XRenderPictureAttributes pa; Pa.subwindow_mode = Include inferior; // do not clamp the QWidget widget to the child widgets; Widget.setGeometry (100, 100, 500, 500); Widget.show (); Picture Picture = XRenderCreatePicture (DP, Window, Format, CPSubwindowMode, & pa); XRenderComposite (dpy, PictOpSrc, picture, none, widget.x11PictureHandle (), 0, 0, 0, 0, 0, 0, 500, 500); XRenderFree Pictures (DP, Picture); Return app.exec ();  

It looks like you need to use

  app.setGraphicsSystem ("Basic");  QPixmap  buffer can be stored instead of default  raster   

.


Comments