[PATCH weston] Convert resources to use wl_resource_init

Pekka Paalanen ppaalanen at gmail.com
Fri Mar 1 01:58:43 PST 2013


On Thu, 28 Feb 2013 15:05:02 -0500
Kristian Høgsberg <hoegsberg at gmail.com> wrote:

> On Thu, Feb 28, 2013 at 01:07:35PM +0200, Pekka Paalanen wrote:
> > On Wed, 27 Feb 2013 21:31:31 -0600
> > Jason Ekstrand <jason at jlekstrand.net> wrote:
> > 
> > > This patch goes along with the 4 wayland patches and updates weston to build
> > > against them.  The main question I have here is what we should do with the
> > > shell surface and the input panel surface.  For some reason, the creation of
> > > these two objects is split into two pieces. The wl_resource_init function
> > > really needs to be called in the first one so it can set up the destroy signal,
> > > however the second one is where the interface and implementaiton are assigned.
> > > In any case, this patch should work and allow weston to build.
> > 
> > It looks like create_shell_surface() is called for two cases:
> > 
> > 1. A client sends wl_shell.get_shell_surface, which is
> > handled in shell_get_shell_surfrace(). This will produce a real new
> > protocol object, which the wl_resource is needed for.
> > 
> > 2. The xwayland window manager built into Weston. The X WM is not a
> > Wayland client, but it must use the shell operations. Hence, it creates
> > a shell_surface without the wl_resource, as there is no client to
> > create the protocol object for. Then it proceeds in calling the shell
> > functions via struct weston_shell_interface with this resourceless
> > shell_surface.
> > 
> > I think it might be cleaner to not embed the wl_resource into
> > shell_surface, but to use wl_client_add_object() instead. That, of
> > course, would be a whole another patch. I just wonder, if the
> > shsurf->resource.destroy_signal is being used also in case 2; in that
> > case shell_surface would need its own destroy signal. *shrug*
> 
> Yeah, we use the destroy signal from the resource in both cases, but
> I'd be ok with using wl_client_add_object() and then adding a destroy
> signal to shell_surface.

Actually, when does a shell_surface get destroyed? When the underlying
wl_surface is destroyed, and only then. Couldn't we just hook it into
the wl_surface's destroy signal instead?

Or is it really imperative, that the shell_surface is still valid, when
the X WM processes the destruction?


Thanks,
pq


More information about the wayland-devel mailing list