[cairo] Avoiding flicker when resizing an Xlib program

Uli Schlachter psychon at znc.in
Tue Sep 10 15:52:17 UTC 2019


Hi,

On 10.09.19 10:49, Bill Purvis wrote:
> I've found that when I resize a window I get terrible flickering - it
> appears to rewrite the
> window contents in black before allowing me to repaint my content.

What is "it"? Is it the X11 server? In most cases, black flickering in
X11 windows occurs, because the BackPixel of a window is set to black.

> I have browsed various
> web pages looking for techniques to resize a surface, but the answer
> always seems to be create
> a new one.

What kind of surface are you looking for? cairo_xlib_surface_set_size()
informs cairo that a Xlib surface changed size (but does not change the
size of the window itself).

If you are talking about image surfaces: I do not understand the following:

> it appears to rewrite the
> window contents in black before allowing me to repaint my content.

If you are creating a new image surface, how does it end up being
visible on X11 without you getting a chance to fill it with the correct
content?

Cheers,
Uli
-- 
"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."


More information about the cairo mailing list