Added XDG compatibility to ivi-shell
[AGL/meta-agl.git] / meta-agl / recipes-graphics / wayland / weston / 0006-ivi-layout-introcuded-surface_create_and_configure.patch
1 index 68ca68ba..c86cbb11 100644
2 --- a/ivi-shell/ivi-layout-shell.h
3 +++ b/ivi-shell/ivi-layout-shell.h
4 @@ -39,6 +39,14 @@ struct weston_view;
5  struct weston_surface;
6  struct ivi_layout_surface;
7  
8 +void
9 +ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
10 +                            int32_t width, int32_t height);
11 +
12 +struct ivi_layout_surface*
13 +ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
14 +                         uint32_t id_surface);
15 +
16  void
17  ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
18                              int32_t width, int32_t height);
19 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
20 index 690af742..086d0fd2 100644
21 --- a/ivi-shell/ivi-layout.c
22 +++ b/ivi-shell/ivi-layout.c
23 @@ -1995,20 +1995,8 @@ ivi_layout_surface_dump(struct weston_surface *surface,
24   * methods of interaction between ivi-shell with ivi-layout
25   */
26  
27 -void
28 -ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
29 -                            int32_t width, int32_t height)
30 -{
31 -       struct ivi_layout *layout = get_instance();
32 -
33 -       /* emit callback which is set by ivi-layout api user */
34 -       wl_signal_emit(&layout->surface_notification.configure_changed,
35 -                      ivisurf);
36 -}
37 -
38 -struct ivi_layout_surface*
39 -ivi_layout_surface_create(struct weston_surface *wl_surface,
40 -                         uint32_t id_surface)
41 +static struct ivi_layout_surface*
42 +surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
43  {
44         struct ivi_layout *layout = get_instance();
45         struct ivi_layout_surface *ivisurf = NULL;
46 @@ -2018,14 +2006,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
47                 return NULL;
48         }
49  
50 -       ivisurf = get_surface(&layout->surface_list, id_surface);
51 -       if (ivisurf != NULL) {
52 -               if (ivisurf->surface != NULL) {
53 -                       weston_log("id_surface(%d) is already created\n", id_surface);
54 -                       return NULL;
55 -               }
56 -       }
57 -
58         ivisurf = calloc(1, sizeof *ivisurf);
59         if (ivisurf == NULL) {
60                 weston_log("fails to allocate memory\n");
61 @@ -2049,7 +2029,55 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
62  
63         wl_list_insert(&layout->surface_list, &ivisurf->link);
64  
65 -       wl_signal_emit(&layout->surface_notification.created, ivisurf);
66 +       return ivisurf;
67 +}
68 +
69 +void
70 +ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
71 +                                int32_t width, int32_t height)
72 +{
73 +       struct ivi_layout *layout = get_instance();
74 +
75 +       /* emit callback which is set by ivi-layout api user */
76 +       wl_signal_emit(&layout->surface_notification.configure_desktop_changed,
77 +                      ivisurf);
78 +}
79 +
80 +struct ivi_layout_surface*
81 +ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
82 +                             uint32_t id_surface)
83 +{
84 +       return surface_create(wl_surface, id_surface);
85 +}
86 +
87 +void
88 +ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
89 +                            int32_t width, int32_t height)
90 +{
91 +       struct ivi_layout *layout = get_instance();
92 +
93 +       /* emit callback which is set by ivi-layout api user */
94 +       wl_signal_emit(&layout->surface_notification.configure_changed,
95 +                      ivisurf);
96 +}
97 +
98 +struct ivi_layout_surface*
99 +ivi_layout_surface_create(struct weston_surface *wl_surface,
100 +                         uint32_t id_surface)
101 +{
102 +       struct ivi_layout *layout = get_instance();
103 +       struct ivi_layout_surface *ivisurf = NULL;
104 +
105 +       ivisurf = get_surface(&layout->surface_list, id_surface);
106 +       if (ivisurf) {
107 +               weston_log("id_surface(%d) is already created\n", id_surface);
108 +               return NULL;
109 +       }
110 +
111 +       ivisurf = surface_create(wl_surface, id_surface);
112 +
113 +       if (ivisurf)
114 +               wl_signal_emit(&layout->surface_notification.created, ivisurf);
115  
116         return ivisurf;
117  }