[PATCH wayland] protocol: make get_subsurface double-buffered

Pekka Paalanen ppaalanen at gmail.com
Tue May 10 10:18:34 UTC 2016


On Tue, 10 May 2016 17:42:59 +0800
Jonas Ã…dahl <jadahl at gmail.com> wrote:

> On Tue, May 10, 2016 at 11:19:29AM +0300, Pekka Paalanen wrote:
> > On Mon, 9 May 2016 07:58:32 -0500
> > Yong Bakos <junk at humanoriented.com> wrote:
> >   
> > > Hi Pekka,
> > > Two minor nits in the description, noted inline below.
> > > 
> > > yong
> > > 
> > > On May 9, 2016, at 6:45 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:  
> > > > 
> > > > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > > > 
> > > > The existing specification was not explicitly clear on when
> > > > wl_subcompositor.get_subsurface request actually adds the sub-surface to
> > > > the parent in the compositor's scenegraph. The implicit assumption was
> > > > that this happens immediately, but it was not written anywhere.
> > > > 
> > > > If it happens immediately, the client doing things in a wrong order may
> > > > cause a glitch on screen. Particularly, if the wl_surface B that is
> > > > going to be a sub-surface for wl_surface A (the parent) already has a
> > > > buffer committed, and the parent surface is mapped, then get_subsurface
> > > > will (may?) cause wl_surface B to become mapped immediately. That leaves
> > > > no time to set up the sub-surface z-order or position before mapping,
> > > > hence there can be a visible glitch.
> > > > 
> > > > The way to avoid that, given that the parent surface is mapped, is to
> > > > not commit a buffer to wl_surface B until all the sub-surface setup is
> > > > done.
> > > > 
> > > > However, doing the sub-surface setup always requires a wl_surface.commit
> > > > on the parent surface unless the defaults happen to be correct.
> > > > 
> > > > To make setting up a subsurface slightly easier by removing one
> > > > possibility for a glitch, this patch amends the specification to require
> > > > a wl_surface.commit on the parent surface for get_subsurface to
> > > > complete. The sub-surface cannot become mapped before a parent commit.
> > > > 
> > > > This change may break existing clients that relied on the glitchy
> > > > sequence to not need a parent surface commit to map the sub-surface.
> > > > However, presumably all uses would at least issue a
> > > > wl_subsurface.set_position, which requires a parent surface commit to
> > > > apply. That would guarantee that there is a parent surface commit after
> > > > get_subsurface, and so reduces the chances of breaking anything.
> > > > 
> > > > In other cases, this change may simply remove a possibility for the
> > > > glitch.
> > > > 
> > > > This patch also adds a note about changing wl_surface.commit behaviour
> > > > on wl_subcompositor.get_subsurface. (That could be a separate patch.)

> > > > +
> > > > +	This request modifies the behaviour of wl_surface.commit request on    
> > > 
> > > requests  
> > 
> > "request" is used as a noun here and there is only one, so I think it's
> > correct as is.
> > 
> > Or which one did you mean? I think the latter is also singular, but I
> > was thinking in interface terms, not as "from now on commits will
> > behave differently" which would be true too, thinking in runtime terms.
> > 
> > Alternative suggestions?  
> 
> It seems to be missing a 'the', as in, it should be:
> 
> "This request modifies the behaviour of the wl_surface.commit request
> on the sub-surface.."
> 
> or simply without the second "request" at all, as in:
> 
> "This request modifies the behaviour of wl_surface.commit on the
> sub-surface, ..."

I'll go with the latter one, thanks,
pq

> 
> 
> Jonas
> 
> > 
> > 
> > Thanks,
> > pq
> >   
> > > > +	the sub-surface, see the documentation on wl_subsurface interface.
> > > >       </description>
> > > > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160510/9042dd23/attachment.sig>


More information about the wayland-devel mailing list