X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Flayout.c;h=bc489b2b3fef8a579f4014b61e3a40cfd7b65fd7;hb=4af44df30c1784a69b96d310f152133a507bc2e1;hp=1773fc82ddb264d6599cdeaad8afc24fe0a10bd3;hpb=adf173ea334eafd233d168815078c4d199b08619;p=src%2Fagl-compositor.git diff --git a/src/layout.c b/src/layout.c index 1773fc8..bc489b2 100644 --- a/src/layout.c +++ b/src/layout.c @@ -312,10 +312,26 @@ ivi_layout_activate_complete(struct ivi_output *output, app_id, ivi_layout_get_surface_role_name(surf), output->name); - if (wl_resource_get_version(ivi->shell_client.resource) >= AGL_SHELL_APP_STATE_SINCE_VERSION) - agl_shell_send_app_state(ivi->shell_client.resource, - app_id, AGL_SHELL_APP_STATE_ACTIVATED); + shell_send_app_state(ivi, app_id, AGL_SHELL_APP_STATE_ACTIVATED); +} + +static bool +ivi_layout_find_output_with_app_id(const char *app_id, struct ivi_output *output) +{ + char *cur; + size_t app_id_len; + + cur = output->app_ids; + app_id_len = strlen(app_id); + while ((cur = strstr(cur, app_id))) { + if ((cur[app_id_len] == ',' || cur[app_id_len] == '\0') && + (cur == output->app_ids || cur[-1] == ',')) + return true; + cur++; + } + + return false; } struct ivi_output * @@ -327,13 +343,12 @@ ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi) return NULL; wl_list_for_each(out, &ivi->outputs, link) { - if (!out->app_id) + if (!out->app_ids) continue; - if (!strcmp(app_id, out->app_id)) + if (ivi_layout_find_output_with_app_id(app_id, out)) return out; } - return NULL; } @@ -773,6 +788,19 @@ ivi_compute_popup_position(const struct weston_output *output, struct weston_vie } +static bool +ivi_surf_in_hidden_layer(struct ivi_compositor *ivi, struct ivi_surface *surface) +{ + struct weston_view *ev; + + wl_list_for_each(ev, &ivi->hidden.view_list.link, layer_link.link) { + if (ev == surface->view) + return true; + } + + return false; +} + void ivi_layout_popup_committed(struct ivi_surface *surface) { @@ -804,6 +832,10 @@ ivi_layout_popup_committed(struct ivi_surface *surface) assert(surface->role == IVI_SURFACE_ROLE_POPUP); + /* remove it from hidden layer if present */ + if (ivi_surf_in_hidden_layer(ivi, surface)) + weston_layer_entry_remove(&view->layer_link); + weston_view_set_output(view, woutput); ivi_compute_popup_position(woutput, view, @@ -927,6 +959,9 @@ ivi_layout_activate_by_surf(struct ivi_output *output, struct ivi_surface *surf) struct ivi_output *remote_output = ivi_layout_find_with_app_id(app_id, ivi); + weston_log("Changed activation for app_id %s, type %s, on output %s\n", app_id, + ivi_layout_get_surface_role_name(surf), output->output->name); + /* if already active on a remote output do not * attempt to activate it again */ if (remote_output && remote_output->active == surf) @@ -1072,7 +1107,5 @@ ivi_layout_deactivate(struct ivi_compositor *ivi, const char *app_id) weston_surface_damage(view->surface); } - if (wl_resource_get_version(ivi->shell_client.resource) >= AGL_SHELL_APP_STATE_SINCE_VERSION) - agl_shell_send_app_state(ivi->shell_client.resource, app_id, - AGL_SHELL_APP_STATE_DEACTIVATED); + shell_send_app_state(ivi, app_id, AGL_SHELL_APP_STATE_DEACTIVATED); }