X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Flayout.c;h=e8fc7670b8d1554161659a0491a83edcef0870e4;hb=42e787290b5067d85f1c04a4c44969fa0cae27d6;hp=1773fc82ddb264d6599cdeaad8afc24fe0a10bd3;hpb=adf173ea334eafd233d168815078c4d199b08619;p=src%2Fagl-compositor.git diff --git a/src/layout.c b/src/layout.c index 1773fc8..e8fc767 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; } @@ -394,8 +409,10 @@ ivi_layout_add_to_hidden_layer(struct ivi_surface *surf, if (surf->hidden_layer_output && surf->hidden_layer_output != ivi_output) { weston_layer_entry_remove(&ev->layer_link); + weston_view_geometry_dirty(ev); + weston_surface_damage(ev->surface); - if (ivi_output->area.width != surf->hidden_layer_output->area.width && + if (ivi_output->area.width != surf->hidden_layer_output->area.width || ivi_output->area.height != surf->hidden_layer_output->area.height) { weston_desktop_surface_set_maximized(dsurf, true); weston_desktop_surface_set_size(dsurf, @@ -927,6 +944,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 +1092,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); }