[cairo] cairo / xlib not updating window content

Bill Spitzak spitzak at gmail.com
Mon Jul 30 16:33:12 UTC 2018


Here is some code that draws in X without using gtk, designed to make small
demos like this.


On Sun, Jul 29, 2018 at 12:47 PM, Cedric Roux <sed at free.fr> wrote:

> On 07/29/2018 05:01 PM, Pavel Petrovic wrote:
> >> Cedric's solution... I'm not quite sure what it does. It fixes some
> >> flickering that is not there? It does double buffering, too, but only
> >> uses a temporary buffer that loses its content afterwards? I felt like
> >> you want your windows to actually retain old content, which that
> >> temporary group does not do...
> >
> > I think that is the magic of the push_group / pop_group that it does
> > retain the old content. When it is pushed, then a copy is created,
> > so you add new content to the previous one, and then paint it
> > back to the visible surface with pop. So both solutions solved
> > all issues.
>
> I don't know the internals of this push/pop thing.
> I see flickering without it, disappears with it.
>
> With my setup (debian, fvwm) the content is not
> retained if I put another window on top of this
> one and then put it away.
>
> Pavel, I think you need a very basic logic with
> one paint() function that has to:
> - clear window: call cairo_rectangle/cairo_fill
> - draw content (cairo_rectangle, draw strings, etc)
> - put content to the X window
> - ensure that the X window is updated
>   (this may require a XFlush for the X part
>    and the push/pop or some other mechanism
>    for the cairo part)
>
> My 2 cents.
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180730/c619fac8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairot.tgz
Type: application/x-compressed-tar
Size: 7557 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180730/c619fac8/attachment.bin>


More information about the cairo mailing list