Accessing an openGL viewport's pixels on multiple X servers

Aaron Plattner aplattner at
Mon May 25 09:54:48 PDT 2009

On Mon, May 25, 2009 at 07:15:33AM -0700, Jerome Guilmette wrote:
> Hi everyone,
> I hope this is the good list to send my question to for it is a rather a
> specific matter. All my tests were done using an NVIDIA GeForce 8600M, driver
> version 180.29, under the Fedora 10 OS.
> Here is my issue: I have a program that takes a few screenshots of an
> application (window) and saves it into a file.  I discovered that, while
> taking a snapshot of an application running an openGL viewport, i.e.
> glxgears, and switching to another X server, I was not able to save the images
> in their integrity, the openGL viewport wasn't displayed. So the raw content
> of an openGL viewport isn't available while we are in another X Server than
> the one the program is running into. So would it mean that only one openGL
> context per X server is possible?

I'm not sure how you concluded that only one context per X server is possible
from the fact that you can't access a window's pixels when the server is not on
the active virtual terminal.  You can definitely have multiple contexts per X

> In a multiple X sessions context, is there a way to have access to the
> rendered openGL viewport pixels while being currently on a different X server
> using standard X functions? In any case, what exactly are the mechanisms in
> place?

No, you can't do that.  When you VT-switch away from the current X server, all
windows are clipped so that no rendering occurs to them, and OpenGL processing
is suspended.  The non-active X server is not supposed to touch the hardware at
all, to allow the active X server to use it.

> Any inputs would be very much appreciated, might it be a link to more
> documentation or a direct answer.

More information about the xorg mailing list