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

2018-03-06 Thread Pekka Paalanen
On Mon, 05 Mar 2018 13:27:27 +0100
Philipp Kerling  wrote:

> Hi,
> 
> thanks for resurrecting this :-) reply below
> 
> 2017-12-04 (月) の 21:37 + に Daniel Stone さんは書きました:
> > Hi Philipp,
> > 
> > On 28 July 2017 at 15:41, Philipp Kerling  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.

Hi,

I didn't actually look at the code, so this comment is a vague
recollection from years ago: if the role interface (here wl_subsurface)
allows a NULL buffer to be committed, then by the general rule it will
cause that wl_surface to be unmapped, and it should also reset the
weston_surface size to zero. I do not recall any reason for not doing
that.

I actually have some hazy recollection of designing the hiding of a
sub-surface to intentionally need attaching a NULL wl_buffer to the
wl_surface, exactly for the synchronization reasons.


Thanks,
pq


pgpHM9mzRH9MQ.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2018-03-05 Thread Philipp Kerling
Hi,

thanks for resurrecting this :-) reply below

2017-12-04 (月) の 21:37 + に Daniel Stone さんは書きました:
> Hi Philipp,
> 
> On 28 July 2017 at 15:41, Philipp Kerling  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
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2017-12-04 Thread Daniel Stone
Hi Philipp,

On 28 July 2017 at 15:41, Philipp Kerling  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
...

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel