summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWataru Natsume <wataru_natsume@xddp.denso.co.jp>2016-06-14 22:16:59 +0900
committerWataru Natsume <wataru_natsume@xddp.denso.co.jp>2016-06-21 19:29:53 +0900
commit48254d857fc8cb82b124b423c1208e2df76f3fcf (patch)
tree6960470196e8b897e8c9b8687223ab7efa254bb1
parenteeef98212f9256699f5420cf192d8ba41ee065ed (diff)
downloadwayland-ivi-extension-48254d857fc8cb82b124b423c1208e2df76f3fcf.tar.gz
ivi-controller: do refactor send_surface_add_event
Check logic should be improved because ivilayer is never null. Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
-rw-r--r--weston-ivi-shell/src/ivi-controller-impl.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c
index af79ded..a8242f6 100644
--- a/weston-ivi-shell/src/ivi-controller-impl.c
+++ b/weston-ivi-shell/src/ivi-controller-impl.c
@@ -164,27 +164,22 @@ send_surface_add_event(struct ivisurface *ivisurf,
else if (mask & IVI_NOTIFICATION_ADD) {
for (i = 0; i < (int)length; i++) {
/* Send new surface event */
- ivilayer = NULL;
if (wl_list_empty(&shell->list_layer)) {
break;
}
wl_list_for_each(ivilayer, &shell->list_layer, link) {
if (ivilayer->layout_layer == pArray[i]) {
+ layer_resource =
+ wl_resource_find_for_client(&ivilayer->resource_list,
+ client);
+ if (layer_resource != NULL) {
+ ivi_controller_surface_send_layer(resource, layer_resource);
+ }
+
break;
}
}
-
- if (ivilayer == NULL) {
- continue;
- }
-
- layer_resource = wl_resource_find_for_client(&ivilayer->resource_list,
- client);
-
- if (layer_resource != NULL) {
- ivi_controller_surface_send_layer(resource, layer_resource);
- }
}
}