[cairo] Avoiding flicker when resizing an Xlib program

Adam Jackson ajax at redhat.com
Tue Sep 10 20:52:53 UTC 2019


On Tue, 2019-09-10 at 09:49 +0100, 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.

The default "bit gravity" for X windows is "ForgetGravity", which means
the server can (and aggressively does) discard window contents whenever
the window's size changes. Most toolkits set this to NorthWestGravity
instead, which will attempt to preserve the pixels in the top-left
(northwest) corner of the window, and will only fill in newly exposed
areas in the bottom and right with the background pixel.

- ajax



More information about the cairo mailing list