1 index e1e897ed..5b1f12f0 100644
2 --- a/ivi-shell/ivi-layout-export.h
3 +++ b/ivi-shell/ivi-layout-export.h
4 @@ -320,6 +320,12 @@ struct ivi_layout_interface {
5 struct ivi_layout_surface *ivisurf,
9 + * \brief set id of ivi_layout_surface
11 + int32_t (*surface_set_id)(struct ivi_layout_surface *ivisurf,
12 + uint32_t id_surface);
15 * layer controller interface
17 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
18 index 298e18ea..fa8e75f6 100644
19 --- a/ivi-shell/ivi-layout.c
20 +++ b/ivi-shell/ivi-layout.c
21 @@ -1901,6 +1901,44 @@ ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf,
26 + * This interface enables e.g. an id agent to set the id of an ivi-layout
27 + * surface, that has been created by a desktop application. This can only be
28 + * done once as long as the initial surface id equals IVI_INVALID_ID. Afterwards
29 + * two events are emitted, namely surface_created and surface_configured.
32 +ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
33 + uint32_t id_surface)
35 + struct ivi_layout *layout = get_instance();
36 + struct ivi_layout_surface *search_ivisurf = NULL;
39 + weston_log("%s: invalid argument\n", __func__);
43 + if (ivisurf->id_surface != IVI_INVALID_ID) {
44 + weston_log("surface id can only be set once\n");
48 + search_ivisurf = get_surface(&layout->surface_list, id_surface);
49 + if (search_ivisurf) {
50 + weston_log("id_surface(%d) is already created\n", id_surface);
54 + ivisurf->id_surface = id_surface;
56 + wl_signal_emit(&layout->surface_notification.created, ivisurf);
57 + wl_signal_emit(&layout->surface_notification.configure_changed,
60 + return IVI_SUCCEEDED;
64 ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf,
65 enum ivi_layout_transition_type type,
66 @@ -2058,6 +2096,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
67 .surface_get_weston_surface = ivi_layout_surface_get_weston_surface,
68 .surface_set_transition = ivi_layout_surface_set_transition,
69 .surface_set_transition_duration = ivi_layout_surface_set_transition_duration,
70 + .surface_set_id = ivi_layout_surface_set_id,
73 * layer controller interfaces