[cairo] Avoiding flicker when resizing an Xlib program

Bill Purvis bill at billp.org
Tue Sep 10 08:49:35 UTC 2019


I've recently started using Cairo with XLib. I've programmed with XLib 
for may years but was
frustrated by the poor handling of text in the basic library. I've now 
written some interface
routines so my original programs can be trivially modified and make use 
of Cairo for the graphics.

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. I 
have browsed various
web pages looking for techniques to resize a surface, but the answer 
always seems to be create
a new one. That's where the flicker started. I then tried creating a 
full-screen sized surface
so that I didn't need to reallocate the surface. That seems to work, but 
still gives me the
flicker.

I've not displaying images, just paths and texts, and want the ability 
to expand or contract
my windows without getting a headache!

Bill

-- 
+----------------------------------------+
| Bill Purvis                            |
| email: bill at billp.org                  |
+----------------------------------------+



More information about the cairo mailing list