<div dir="ltr">Here is some code that draws in X without using gtk, designed to make small demos like this.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 29, 2018 at 12:47 PM, Cedric Roux <span dir="ltr"><<a href="mailto:sed@free.fr" target="_blank">sed@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/29/2018 05:01 PM, Pavel Petrovic wrote:<br>
>> Cedric's solution... I'm not quite sure what it does. It fixes some<br>
>> flickering that is not there? It does double buffering, too, but only<br>
>> uses a temporary buffer that loses its content afterwards? I felt like<br>
>> you want your windows to actually retain old content, which that<br>
>> temporary group does not do...<br>
> <br>
> I think that is the magic of the push_group / pop_group that it does<br>
> retain the old content. When it is pushed, then a copy is created,<br>
> so you add new content to the previous one, and then paint it<br>
> back to the visible surface with pop. So both solutions solved<br>
> all issues.<br>
<br>
</span>I don't know the internals of this push/pop thing.<br>
I see flickering without it, disappears with it.<br>
<br>
With my setup (debian, fvwm) the content is not<br>
retained if I put another window on top of this<br>
one and then put it away.<br>
<br>
Pavel, I think you need a very basic logic with<br>
one paint() function that has to:<br>
- clear window: call cairo_rectangle/cairo_fill<br>
- draw content (cairo_rectangle, draw strings, etc)<br>
- put content to the X window<br>
- ensure that the X window is updated<br>
(this may require a XFlush for the X part<br>
and the push/pop or some other mechanism<br>
for the cairo part)<br>
<br>
My 2 cents.<br>
<div class="HOEnZb"><div class="h5">-- <br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="https://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">https://lists.cairographics.<wbr>org/mailman/listinfo/cairo</a></div></div></blockquote></div><br></div>