Re: Static items (Was: Can this be done with goocanvas?)



On Sun, 2008-10-26 at 21:15 +0000, Damon Chaplin wrote:
> On Wed, 2008-10-22 at 12:05 +0100, Damon Chaplin wrote:
> > On Wed, 2008-10-22 at 11:04 +0100, Gustavo J. A. M. Carneiro wrote:
> > 
> > > So, in summary, I really do get the feeling that goocanvas using
> > > g_signal_connect_after for the scrolled window adjustments would solve
> > > my problem.  But I did not try it yet to make sure.
> > 
> > I'm not so sure that would help but you could try it.
> > 
> > GooCanvas uses the same scrolling technique as GtkLayout - it moves the
> > large canvas GdkWindow around behind the small viewport window so that
> > the windowing system (X Windows or win32) does the scrolling.
> > 
> > So I think it would be pretty hard to avoid flicker for the items that
> > stay in one place, since your redrawing is always going to happen
> > slightly after the item has already been scrolled.
> 
> I just had another go at this today. I've got it basically working, and
> I've managed to avoid the problem where the static item is dragged with
> the rest of the canvas. But I can't get rid of the flicker completely.
> 
> I'll hopefully commit it to svn in a day or two once I've finished it,
> and maybe we'll be able to minimize the flicker in future.

Today I tried replacing connect with connect_after for the adjustment
signals.  It does not solve the flicker, but it helps keep the static
items more static.  Not sure whether you did the same thing, but I'd
like to just drop this node.

> 
> (There is one way I tried which avoids flicker completely - redraw the
> entire window when scrolling. Of course the problem then is performance,
> but with only a few items on the canvas it works great.)

I see.  The performance would not be great, but for sure that is the
only way this is ever going to work flicker free[1].  Maybe making this
an option?  Those that want to draw static overlay items would activate
the option, otherwise it would be disabled by default.


[1] either that or draw the static items on another X11 window with
alpha channel and let a compositing manager do basically the same work
but in hardware accelerated opengl ;-)  

> 
> Damon
> 
> 
-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
"The universe is always one step beyond logic" -- Frank Herbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]