From d99f8683f5d4a7aaa66007a688651b0d2637f010 Mon Sep 17 00:00:00 2001 From: Emre Ucan Date: Thu, 21 Jan 2016 11:22:48 +0100 Subject: ivi-controller: don't send wrong layer resource to client It is wrong to send surface_send_layer event with resources of every client. Instead, the event should only sent once with the layer resource of client, which owns also the surface resource. Otherwise a wayland communication error happens, because a client gets a surface_send_layer event with a resource which is owned by another client. Signed-off-by: Emre Ucan --- weston-ivi-shell/src/ivi-controller-impl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c index 8b8ab81..235aacd 100644 --- a/weston-ivi-shell/src/ivi-controller-impl.c +++ b/weston-ivi-shell/src/ivi-controller-impl.c @@ -154,6 +154,7 @@ send_surface_add_event(struct ivisurface *ivisurf, int i = 0; struct ivilayer *ivilayer = NULL; struct ivishell *shell = ivisurf->shell; + struct wl_client *client = wl_resource_get_client(resource); ans = ivi_extension_get_layers_under_surface(shell, ivisurf->layout_surface, &length, &pArray); @@ -180,7 +181,10 @@ send_surface_add_event(struct ivisurface *ivisurf, continue; } - wl_resource_for_each(layer_resource, &ivilayer->resource_list) { + layer_resource = wl_resource_find_for_client(&ivilayer->resource_list, + client); + + if (layer_resource != NULL) { ivi_controller_surface_send_layer(resource, layer_resource); } } -- cgit v1.2.1