how to tell a window is completely redrawn?

Irek Szczesniak ijs at txcorp.com
Tue Mar 8 15:49:42 PST 2005


Thank you for your e-mail!  I appreciate your advice.  
However, my problem is still unresolved.

On Tue, 8 Mar 2005, Deron Johnson wrote:

> However, if the XGetImage is in another process from the one doing
> the drawing, you'll have to establish your own interprocess
> communication protocol for the app to tell your XGetImage process
> when it has flushed its final drawing request to the X server.

I have no way of establishing such a communication.  These
applications do not know that I want to take pictures of their
windows.  Modifying the applications and recompiling them is not
possible.

> In general, if you want to make sure that the rendering of an
> arbitrary X request has been written to the frame buffer, you simply
> need to do an XFlush followed by an XGetImage of one pixel from the
> window. This is sufficient to ensure that the contents of all
> rendering queues (including those in the DDX and the hardware
> itself) have been flushed out to the frame buffer.

Based on what you wrote, I tested this:

XMapRaised(dpy, window);
XFlush(dpy);

image = XGetImage (dpy, window, x, y, 1, 1, AllPlanes, format);
image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);

Unfortunately, it does not work as expected, i.e. I get a picture of
an uncompletely redrawn window.

Then I also tried this:

image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);
image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);

But also to no avail.

What am I doing wrong?


Thank you & best,
Irek

*******************************************************************

> Irek Szczesniak wrote:
> > Hello,
> > 
> > I need to wait for a window to be completely redrawn, and then take a
> > picture of it with XGetImage.  This window is not mine, and the only
> > thing I know about it is its ID.
> > 
> > How can I tell that the X server has compeletly redrawn the window?
> > 
> > I would appreciate your time and advice.
> > 
> > 
> > Thank you,
> > Irek
> > 
> > 
> > _______________________________________________
> > xserver mailing list
> > xserver at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/xserver






More information about the xorg mailing list