summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-06-19 15:08:23 +0900
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-06-30 11:35:27 +0900
commit713279c0cba2a4a66b0e7733a7525f07a71960f5 (patch)
tree21431fae21253bcd739cb68e7412f13e20bc7e98
parent6ac91a8a8e3900bc7396c5ad1e0b7f41d94611df (diff)
downloadwayland-ivi-extension-713279c0cba2a4a66b0e7733a7525f07a71960f5.tar.gz
ilmControl and weston-ivi-shell : Send correct events of surface.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r--ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c6
-rwxr-xr-xweston-ivi-shell/src/ivi-controller.c104
2 files changed, 48 insertions, 62 deletions
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
index 67dc8b4..6fd7dbc 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -1067,11 +1067,7 @@ remove_ordersurface_from_layer(struct wayland_context *ctx,
wl_list_for_each_safe(ctx_ordersurf, next,
&ctx_layer->order.list_surface,
order.link) {
- pxy_surf = (struct wl_proxy*)ctx_surf->surface;
- pxy_ordersurf = (struct wl_proxy*)ctx_ordersurf->surface;
- id_surf = wl_proxy_get_id(pxy_surf);
- id_ordersurf = wl_proxy_get_id(pxy_ordersurf);
- if (id_surf == id_ordersurf) {
+ if (ctx_surf->id_surface == ctx_ordersurf->id_surface) {
wl_list_remove(&ctx_ordersurf->order.link);
}
}
diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
index 21a9404..b192c64 100755
--- a/weston-ivi-shell/src/ivi-controller.c
+++ b/weston-ivi-shell/src/ivi-controller.c
@@ -345,7 +345,8 @@ controller_screen_create(struct ivishell *shell,
static void
send_surface_add_event(struct ivisurface *ivisurf,
- struct wl_resource *resource)
+ struct wl_resource *resource,
+ enum ivi_layout_notification_mask mask)
{
struct ivi_layout_layer **pArray = NULL;
uint32_t length = 0;
@@ -357,6 +358,7 @@ send_surface_add_event(struct ivisurface *ivisurf,
struct ivilayer *ivilayer = NULL;
struct ivishell *shell = ivisurf->shell;
uint32_t id_layout_layer = 0;
+ struct wl_client *surface_client = wl_resource_get_client(resource);
int found = 0;
ans = ivi_layout_getLayersUnderSurface(ivisurf->layout_surface,
@@ -367,69 +369,54 @@ send_surface_add_event(struct ivisurface *ivisurf,
}
/* Send Null to cancel added surface */
- wl_list_for_each_safe(link_layer, next, &ivisurf->list_layer, link) {
- for (i = 0, found = 0; i < (int)length; i++) {
- if (pArray[i] == link_layer->layer->layout_layer) {
- /* No need to send event, if new layer doesn't be added. */
- found = 1;
- break;
- }
- }
- if (found != 0) {
- continue;
+ if (mask & IVI_NOTIFICATION_REMOVE) {
+ wl_list_for_each_safe(link_layer, next, &ivisurf->list_layer, link) {
+ ivi_controller_surface_send_layer(resource, NULL);
+ wl_list_remove(&link_layer->link);
+ free(link_layer);
+ link_layer = NULL;
}
-
- ivi_controller_surface_send_layer(resource, NULL);
- wl_list_remove(&link_layer->link);
- free(link_layer);
- link_layer = NULL;
}
-
- for (i = 0; i < (int)length; i++) {
- found = 0;
- wl_list_for_each(link_layer, &ivisurf->list_layer, link) {
- if (pArray[i] == link_layer->layer->layout_layer) {
- /* No need to send event, if new layer doesn't be added. */
- found = 1;
- break;
+ else if (mask & IVI_NOTIFICATION_ADD) {
+ for (i = 0; i < (int)length; i++) {
+ /* Create list_layer */
+ link_layer = calloc(1, sizeof(*link_layer));
+ if (NULL == link_layer) {
+ continue;
}
- }
- if (found != 0) {
- continue;
- }
-
- /* Create list_layer */
- link_layer = calloc(1, sizeof(*link_layer));
- if (NULL == link_layer) {
- continue;
- }
- wl_list_init(&link_layer->link);
- link_layer->layer = NULL;
- wl_list_for_each(ivilayer, &shell->list_layer, link) {
- if (ivilayer->layout_layer == pArray[i]) {
- link_layer->layer = ivilayer;
- break;
+ wl_list_init(&link_layer->link);
+ link_layer->layer = NULL;
+ wl_list_for_each(ivilayer, &shell->list_layer, link) {
+ if (ivilayer->layout_layer == pArray[i]) {
+ link_layer->layer = ivilayer;
+ break;
+ }
}
- }
-
- if (link_layer->layer == NULL) {
- free(link_layer);
- link_layer = NULL;
- continue;
- }
- wl_list_insert(&ivisurf->list_layer, &link_layer->link);
- /* Send new surface event */
- id_layout_layer =
- ivi_layout_getIdOfLayer(link_layer->layer->layout_layer);
- wl_list_for_each(ctrllayer, &shell->list_controller_layer, link) {
- if (id_layout_layer != ctrllayer->id_layer) {
+ if (link_layer->layer == NULL) {
+ free(link_layer);
+ link_layer = NULL;
continue;
}
- if (resource != ctrllayer->resource) {
- continue;
+
+ struct link_layer *layer_link = NULL;
+ wl_list_insert(&ivisurf->list_layer, &link_layer->link);
+
+ /* Send new surface event */
+ id_layout_layer =
+ ivi_layout_getIdOfLayer(link_layer->layer->layout_layer);
+ wl_list_for_each(ctrllayer, &shell->list_controller_layer, link) {
+ if (id_layout_layer != ctrllayer->id_layer) {
+ continue;
+ }
+
+ struct wl_client *layer_client = wl_resource_get_client(ctrllayer->resource);
+ if (surface_client != layer_client) {
+ continue;
+ }
+
+ ivi_controller_surface_send_layer(resource, ctrllayer->resource);
}
- ivi_controller_surface_send_layer(resource, ctrllayer->resource);
}
}
@@ -470,7 +457,10 @@ send_surface_event(struct wl_resource *resource,
prop->pixelformat);
}
if (mask & IVI_NOTIFICATION_ADD) {
- send_surface_add_event(ivisurf, resource);
+ send_surface_add_event(ivisurf, resource, IVI_NOTIFICATION_ADD);
+ }
+ if (mask & IVI_NOTIFICATION_REMOVE) {
+ send_surface_add_event(ivisurf, resource, IVI_NOTIFICATION_REMOVE);
}
}