X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Flayout.c;h=028ff4a58737243028784d296d7e7d8fd20445bb;hb=refs%2Fchanges%2F05%2F28505%2F1;hp=f2fc6cc6a25318bbee828b03544662b06767db08;hpb=c42f50b567a0d5adf2c51322d4d46e33ce4ccb59;p=src%2Fagl-compositor.git diff --git a/src/layout.c b/src/layout.c index f2fc6cc..028ff4a 100644 --- a/src/layout.c +++ b/src/layout.c @@ -315,6 +315,25 @@ ivi_layout_activate_complete(struct ivi_output *output, 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 * ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi) { @@ -324,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; } @@ -924,6 +942,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)