2

Working on a sort of Motif GUI design tool. After I programmatically change a property, add/remove widgets, move widgets around, etc, I capture a screenshot of the Motif window showing the current window state. FYI, I'm using cairo 2d to capture the Xlib surface of the window as a png.

Mostly this works fine but sometimes my window capture happens before the UI update has completed. In particular I've noticed this occasionally when changing a widget's font or changing the pixmap on a graphical label.

I want to wait until the window has finished drawing the new state before capturing the surface.

How can I do that reliably? It looks like Xlib exposure events occur prior to redraw. And I see there's a PropertyChange event - but the documentation doesn't say anything about when it happens in relation to drawing.

cdr
  • 351
  • 3
  • 5

0 Answers0