wl_shell: properly set wl_surface->resource

This commit is contained in:
emersion 2017-09-28 01:10:39 +02:00
parent d41a4a0bae
commit eaa414bbd8
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 4 additions and 5 deletions

View File

@ -306,13 +306,12 @@ static void wl_shell_get_shell_surface(struct wl_client *client,
wl_surface->shell = wl_shell;
wl_surface->client = client;
wl_surface->resource = surface_resource;
wl_surface->surface = surface;
struct wl_resource *shell_surface_resource = wl_resource_create(client,
&wl_shell_surface_interface, wl_resource_get_version(resource), id);
wlr_log(L_DEBUG, "New wl_shell %p (res %p)", wl_surface, shell_surface_resource);
wl_resource_set_implementation(shell_surface_resource,
wl_surface->resource = wl_resource_create(client, &wl_shell_surface_interface,
wl_resource_get_version(resource), id);
wlr_log(L_DEBUG, "new wl_shell %p (res %p)", wl_surface, wl_surface->resource);
wl_resource_set_implementation(wl_surface->resource,
&shell_surface_interface, wl_surface, destroy_shell_surface);
wl_signal_init(&wl_surface->events.destroy);