summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWataru Natsume <wataru_natsume@xddp.denso.co.jp>2016-06-15 15:48:27 +0900
committerWataru Natsume <wataru_natsume@xddp.denso.co.jp>2016-06-21 19:30:00 +0900
commitb8497b802539ce6e05aace55f6c8799ae5aea929 (patch)
tree8d05f76259f7a975cfcdc52976f9b5571c51d33f
parent48254d857fc8cb82b124b423c1208e2df76f3fcf (diff)
downloadwayland-ivi-extension-b8497b802539ce6e05aace55f6c8799ae5aea929.tar.gz
ivi-controller: do refactor send_layer_add_event
Check logic should be improved because iviscrn is never null. Besides, do not iterate over empty list like send_surface_add_event. Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
-rw-r--r--weston-ivi-shell/src/ivi-controller-impl.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c
index a8242f6..490f4c1 100644
--- a/weston-ivi-shell/src/ivi-controller-impl.c
+++ b/weston-ivi-shell/src/ivi-controller-impl.c
@@ -292,23 +292,22 @@ send_layer_add_event(struct ivilayer *ivilayer,
else if (mask & IVI_NOTIFICATION_ADD) {
for (i = 0; i < (int)length; i++) {
/* Send new layer event */
- iviscrn = NULL;
+ if (wl_list_empty(&shell->list_screen)){
+ break;
+ }
+
wl_list_for_each(iviscrn, &shell->list_screen, link) {
if (iviscrn->layout_screen == pArray[i]) {
+ resource_output =
+ wl_resource_find_for_client(&iviscrn->output->resource_list,
+ client);
+ if (resource_output != NULL) {
+ ivi_controller_layer_send_screen(resource, resource_output);
+ }
+
break;
}
}
-
- if (iviscrn == NULL) {
- continue;
- }
-
- resource_output =
- wl_resource_find_for_client(&iviscrn->output->resource_list,
- client);
- if (resource_output != NULL) {
- ivi_controller_layer_send_screen(resource, resource_output);
- }
}
}