Re: [PATCH] example for gtk-demo demonstrating offscreen-rendered widgets with reflection-effect



sorry for the long delay in replying.  it's been a hectic week with
family events and friends back from school to visit.

the problem is pretty simple.  i'm not sure it is explicitly documented
as such, but i've mentioned before that the redirection is currently
only supported for 1:1 mappings.  the problem is that the damage events
on the real widget's window turn into expose events on the parent in a
1:1 way.

if you make a change to the content of the entire GtkEntry then that
will turn into a damage event for only that rectangle, and an expose
event for only that rectangle.

essentially, MacSlow: you are cheating.  your expose event handler is
drawing outside of the area of the expose event.  generally speaking,
you _can't do this ever_.  with double buffering enabled this is a
really serious problem because the pixmap that is created for the double
buffer isn't the size of the entire window but rather only the size of
the bounding box of the expose event -> you lose.

the correct solution is to allow the specification of some sort of a
geometry mapping at the level that the damage events are converted to
expose events.  at this point you could specify the areas that you
intend an update of a given pixel to affect (by some sort of a matrix or
mesh or something [your demo makes a compelling case for allowing
possibly several of them]).  the idea was to wait until the X input
transformation stuff was more concrete but the impression i get from
talking to a couple of people is that this stuff will land along with
the next US shuttle on the moon....

the idea would then be that we would use the same transformation
matrix/mesh/whatever for both input events and expose events.  this
would automatically allow you to do stuff like click on the shadows of
the buttons....

as for your current code: you should know that it is a gigantic hack
that generally breaks the rules of how gtk applications should work.  if
you want to document it as such, then that's cool.  otherwise, there's
currently no way to fix it properly :(

sorry....

cheers

On Tue, 2007-12-25 at 17:55 -0500, Behdad Esfahbod wrote:
> On Tue, 2007-12-25 at 10:31 -0500, Mirco Müller wrote:
> > 
> >         What's causing the reflection not to be updated correctly, if
> > double
> > buffering is enabled for the top-level window, is a mystery to me
> > still.
> 
> desrt had similar issues which were caused by an xorg bug.  Check with
> him.
> 



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