summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmre Ucan <eucan@de.adit-jv.com>2016-01-21 11:22:48 +0100
committerWataru Natsume <wataru_natsume@xddp.denso.co.jp>2016-02-05 19:05:11 +0900
commitd99f8683f5d4a7aaa66007a688651b0d2637f010 (patch)
treebff3917024057b5ae4e123f46f14617ccb2289ad
parent01a6dc0ae98ebe6ed59fe6fa138bd088b68f6d7e (diff)
downloadwayland-ivi-extension-d99f8683f5d4a7aaa66007a688651b0d2637f010.tar.gz
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 <eucan@de.adit-jv.com>
-rw-r--r--weston-ivi-shell/src/ivi-controller-impl.c6
1 files changed, 5 insertions, 1 deletions
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);
}
}