[RFC weston] libweston: Do not include subsurfaces with NULL buffer in bounding box

Philipp Kerling pkerling at casix.org
Mon Mar 5 12:27:27 UTC 2018


Hi,

thanks for resurrecting this :-) reply below

2017-12-04 (月) の 21:37 +0000 に Daniel Stone さんは書きました:
> Hi Philipp,
> 
> On 28 July 2017 at 15:41, Philipp Kerling <pkerling at casix.org> wrote:
> > I was pondering how to remove the window decorations of my
> > application
> > (which live in subsurfaces) when going full screen without
> > flickering.
> > 
> > At first I just destroyed the surfaces, but that lead to flicker
> > (window without decoration will appear for one frame before the
> > full
> > screen application is displayed) since subsurface destruction is
> > not
> > specified to be synchronized to the commit of the main surface.
> > 
> > Then I tried attaching a NULL wl_buffer to the surfaces. This works
> > and
> > does not flicker, but it has the problem that weston will
> > disconnect my
> > application when going to full screen for violating the configured
> > xdg_shell buffer size. The reason seems to be that attaching a NULL
> > wl_buffer does not reset the surface size and
> > weston_surface_get_bounding_box still thinks that the surface has
> > the
> > prior size.
> > 
> > The patch fixes this by checking explicitly for the buffer and is
> > confirmed to fix the issue, but I am not sure whether this is the
> > right
> > solution. Maybe surface->width and surface->height should be set to
> > 0
> > anyway?
> 
> Hm. Yes, it does seem like the width/height should be 0, which is
> undefined but not disallowed by the subsurface spec. I have no idea
> if
> this would work with Mutter in particular, which had problems
> implementing that for top-levels.
> 
> In any case, perhaps one way you could do it would be to stack the
> decoration subsurfaces below your primary surface before committing
> your fullscreen buffer. It's ugly, but does seem like it should work
> ...
I already did solve the problem for my application by attaching a NULL
buffer and explicitly setting the window geometry on my xdg toplevel -
then the bounding box calculation code in weston is not executed (think
that was discussed in IRC).
Still, it would be nice to get this right in weston, which is what the
patch was about.

With "setting width/height to 0" I was referring to the variables in
the weston code (subsurface->surface->width and ...->height), which I
think may be better set to 0 if no buffer is attached to the
subsurface. Currently, they seem to retain the size of the last
attached buffer if you attach a NULL buffer.

Best wishes,
Philipp


More information about the wayland-devel mailing list