Re: cairo / xlib not updating window content

Bill Spitzak <[email protected]> Mon, 30 Jul 2018 09:33:12 -0700
Newsgroups gmane.comp.lib.cairo
Message-ID <CAL-8oAjNQ6WMeQzQCM=J5djnx6GODFmg1CO-sjmuKOyHf3okqQ@mail.gmail.com>
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 <[email protected]> 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
> [email protected]
> https://lists.cairographics.org/mailman/listinfo/cairo
>

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
cairot.tgz (application/x-compressed-tar, 7.4 KB) - not displayed