I am trying to make a screenshot of a not visible window under X.
My first attempt was to capture the window using
import (from ImageMagick).
Unfortunately when window is under some other windows the hidden parts are black.
What's even worse is that when window is not on the current desktop I get a
The next thought was to use Xnest which would create a new X instance just for this one application and it would be always on top. And I run across other problem. Xnest does not support OpenGL.
Some searching on google and I find [Xephyr] which does support OpenGL... but not hardware accelerated so it's not accaptable as it kills my CPU.
The same goes for Xvfb which also uses CPU to render OpenGL. Below is part of the output from the
OpenGL vendor string: Mesa Project OpenGL renderer string: Software Rasterizer OpenGL version string: 2.1 Mesa 7.8.2 OpenGL shading language version string: 1.20
The only thing left that I can think of is to somehow use Xlib to force my X server to render window to a pixbuf. Unfortunately I have almost no knowledge of Xlib.
So my question is how can I get a screenshot from a not visible window of a application which uses OpenGL under X?
As for now I am only able to make a screenshot using [Python-Xlib] and PIL. Also any other solution using Python or C is acceptable.