aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-profile-graphical/recipes-graphics/wayland/weston')
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch46
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch66
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch11
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch18
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch73
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch74
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch117
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch74
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch30
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch166
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch24
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch34
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch133
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch164
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch107
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch130
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch82
17 files changed, 1349 insertions, 0 deletions
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch
new file mode 100644
index 000000000..bd1a72b0f
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch
@@ -0,0 +1,46 @@
+From 6c145cea35f0b77613d6e3f48679c976b9839d7c Mon Sep 17 00:00:00 2001
+From: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Date: Wed, 31 May 2017 22:48:18 +0000
+Subject: [PATCH] Allow regular users to launch Weston
+
+Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
+---
+ configure.ac | 6 ++++++
+ libweston/launcher-direct.c | 2 ++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 7e84c14..8b3e17e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -155,6 +155,12 @@ if test x$enable_xkbcommon = xyes; then
+ true)
+ fi
+
++AC_ARG_ENABLE(sys-uid, [ --enable-sys-uid],,
++ enable_sys_uid=no)
++if test x$enable_sys_uid = xyes; then
++ AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston])
++fi
++
+ AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
+ enable_setuid_install=yes)
+ AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
+diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
+index 4fc1c3c..8f16a69 100644
+--- a/libweston/launcher-direct.c
++++ b/libweston/launcher-direct.c
+@@ -275,8 +275,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
+ {
+ struct launcher_direct *launcher;
+
++#ifndef ENABLE_SYS_UID
+ if (geteuid() != 0)
+ return -EINVAL;
++#endif
+
+ launcher = zalloc(sizeof(*launcher));
+ if (launcher == NULL)
+--
+2.7.4
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch
new file mode 100644
index 000000000..449b7a0fd
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch
@@ -0,0 +1,66 @@
+index 67619b8f..e9ddf9a4 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -497,44 +497,53 @@ wet_shell_init(struct weston_compositor *compositor,
+ {
+ struct ivi_shell *shell;
+ struct ivi_shell_setting setting = { };
+- int retval = -1;
+
+ shell = zalloc(sizeof *shell);
+ if (shell == NULL)
+ return -1;
+
+ if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0)
+- return -1;
++ goto err_shell;
+
+ init_ivi_shell(compositor, shell, &setting);
++ /* TODO deinit_ivi_shell should be implemented, since init_ivi_shell is
++ * initializing multiple lists. */
+
+ shell->destroy_listener.notify = shell_destroy;
+ wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
+
+ if (input_panel_setup(shell) < 0)
+- goto out_settings;
++ goto err_settings;
+
+ shell->text_backend = text_backend_init(compositor);
+ if (!shell->text_backend)
+- goto out_settings;
++ goto err_settings;
+
+ if (wl_global_create(compositor->wl_display,
+ &ivi_application_interface, 1,
+ shell, bind_ivi_application) == NULL)
+- goto out_settings;
++ goto err_text_backend;
+
+ ivi_layout_init_with_compositor(compositor);
++ /* TODO ivi_layout_destroy should be implemented, since multiple lists
++ * and signals are initialized.*/
+ shell_add_bindings(compositor, shell);
+
+ /* Call module_init of ivi-modules which are defined in weston.ini */
+ if (load_controller_modules(compositor, setting.ivi_module,
+ argc, argv) < 0)
+- goto out_settings;
++ goto err_text_backend;
++
++ return IVI_SUCCEEDED;
+
+- retval = 0;
++err_text_backend:
++ text_backend_destroy(shell->text_backend);
+
+-out_settings:
++err_settings:
+ free(setting.ivi_module);
+
+- return retval;
++err_shell:
++ free(shell);
++
++ return IVI_FAILED;
+ }
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch
new file mode 100644
index 000000000..4507e769c
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch
@@ -0,0 +1,11 @@
+index e9ddf9a4..f3156d35 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -114,7 +114,6 @@ shell_surface_send_configure(struct weston_surface *surface,
+ struct ivi_shell_surface *shsurf;
+
+ shsurf = get_ivi_shell_surface(surface);
+- assert(shsurf);
+ if (!shsurf)
+ return;
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch
new file mode 100644
index 000000000..6f683ca92
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch
@@ -0,0 +1,18 @@
+index 2317d6e9..e1e897ed 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -56,12 +56,14 @@ extern "C" {
+ #endif /* __cplusplus */
+
+ #include <stdint.h>
++#include <limits.h>
+
+ #include "stdbool.h"
+ #include "compositor.h"
+
+ #define IVI_SUCCEEDED (0)
+ #define IVI_FAILED (-1)
++#define IVI_INVALID_ID UINT_MAX
+
+ struct ivi_layout_layer;
+ struct ivi_layout_screen;
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch
new file mode 100644
index 000000000..6401c5b81
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch
@@ -0,0 +1,73 @@
+index e1e897ed..5b1f12f0 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -320,6 +320,12 @@ struct ivi_layout_interface {
+ struct ivi_layout_surface *ivisurf,
+ uint32_t duration);
+
++ /**
++ * \brief set id of ivi_layout_surface
++ */
++ int32_t (*surface_set_id)(struct ivi_layout_surface *ivisurf,
++ uint32_t id_surface);
++
+ /**
+ * layer controller interface
+ */
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 298e18ea..fa8e75f6 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1901,6 +1901,44 @@ ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf,
+ return 0;
+ }
+
++/*
++ * This interface enables e.g. an id agent to set the id of an ivi-layout
++ * surface, that has been created by a desktop application. This can only be
++ * done once as long as the initial surface id equals IVI_INVALID_ID. Afterwards
++ * two events are emitted, namely surface_created and surface_configured.
++ */
++static int32_t
++ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
++ uint32_t id_surface)
++{
++ struct ivi_layout *layout = get_instance();
++ struct ivi_layout_surface *search_ivisurf = NULL;
++
++ if (!ivisurf) {
++ weston_log("%s: invalid argument\n", __func__);
++ return IVI_FAILED;
++ }
++
++ if (ivisurf->id_surface != IVI_INVALID_ID) {
++ weston_log("surface id can only be set once\n");
++ return IVI_FAILED;
++ }
++
++ search_ivisurf = get_surface(&layout->surface_list, id_surface);
++ if (search_ivisurf) {
++ weston_log("id_surface(%d) is already created\n", id_surface);
++ return IVI_FAILED;
++ }
++
++ ivisurf->id_surface = id_surface;
++
++ wl_signal_emit(&layout->surface_notification.created, ivisurf);
++ wl_signal_emit(&layout->surface_notification.configure_changed,
++ ivisurf);
++
++ return IVI_SUCCEEDED;
++}
++
+ static int32_t
+ ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf,
+ enum ivi_layout_transition_type type,
+@@ -2058,6 +2096,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ .surface_get_weston_surface = ivi_layout_surface_get_weston_surface,
+ .surface_set_transition = ivi_layout_surface_set_transition,
+ .surface_set_transition_duration = ivi_layout_surface_set_transition_duration,
++ .surface_set_id = ivi_layout_surface_set_id,
+
+ /**
+ * layer controller interfaces
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch
new file mode 100644
index 000000000..ddd949e35
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch
@@ -0,0 +1,74 @@
+index 5b1f12f0..dd0997aa 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -187,6 +187,16 @@ struct ivi_layout_interface {
+ */
+ int32_t (*add_listener_configure_surface)(struct wl_listener *listener);
+
++ /**
++ * \brief add a listener for notification when desktop_surface is configured
++ *
++ * When an desktop_surface is configured, a signal is emitted
++ * to the listening controller plugins.
++ * The pointer of the configured desktop_surface is sent as the void *data argument
++ * to the wl_listener::notify callback function of the listener.
++ */
++ int32_t (*add_listener_configure_desktop_surface)(struct wl_listener *listener);
++
+ /**
+ * \brief Get all ivi_surfaces which are currently registered and managed
+ * by the services
+diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
+index 2b8bd472..fe5be01a 100644
+--- a/ivi-shell/ivi-layout-private.h
++++ b/ivi-shell/ivi-layout-private.h
+@@ -104,6 +104,7 @@ struct ivi_layout {
+ struct wl_signal created;
+ struct wl_signal removed;
+ struct wl_signal configure_changed;
++ struct wl_signal configure_desktop_changed;
+ } surface_notification;
+
+ struct weston_layer layout_layer;
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index fa8e75f6..690af742 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1040,6 +1040,21 @@ ivi_layout_add_listener_configure_surface(struct wl_listener *listener)
+ return IVI_SUCCEEDED;
+ }
+
++static int32_t
++ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener)
++{
++ struct ivi_layout *layout = get_instance();
++
++ if (!listener) {
++ weston_log("ivi_layout_add_listener_configure_desktop_surface: invalid argument\n");
++ return IVI_FAILED;
++ }
++
++ wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener);
++
++ return IVI_SUCCEEDED;
++}
++
+ uint32_t
+ ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf)
+ {
+@@ -2057,6 +2072,7 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
+ wl_signal_init(&layout->surface_notification.created);
+ wl_signal_init(&layout->surface_notification.removed);
+ wl_signal_init(&layout->surface_notification.configure_changed);
++ wl_signal_init(&layout->surface_notification.configure_desktop_changed);
+
+ /* Add layout_layer at the last of weston_compositor.layer_list */
+ weston_layer_init(&layout->layout_layer, ec);
+@@ -2081,6 +2097,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ .add_listener_create_surface = ivi_layout_add_listener_create_surface,
+ .add_listener_remove_surface = ivi_layout_add_listener_remove_surface,
+ .add_listener_configure_surface = ivi_layout_add_listener_configure_surface,
++ .add_listener_configure_desktop_surface = ivi_layout_add_listener_configure_desktop_surface,
+ .get_surface = shell_get_ivi_layout_surface,
+ .get_surfaces = ivi_layout_get_surfaces,
+ .get_id_of_surface = ivi_layout_get_id_of_surface,
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch
new file mode 100644
index 000000000..04461a1d4
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch
@@ -0,0 +1,117 @@
+index 68ca68ba..c86cbb11 100644
+--- a/ivi-shell/ivi-layout-shell.h
++++ b/ivi-shell/ivi-layout-shell.h
+@@ -39,6 +39,14 @@ struct weston_view;
+ struct weston_surface;
+ struct ivi_layout_surface;
+
++void
++ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height);
++
++struct ivi_layout_surface*
++ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface);
++
+ void
+ ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height);
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 690af742..086d0fd2 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1995,20 +1995,8 @@ ivi_layout_surface_dump(struct weston_surface *surface,
+ * methods of interaction between ivi-shell with ivi-layout
+ */
+
+-void
+-ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+- int32_t width, int32_t height)
+-{
+- struct ivi_layout *layout = get_instance();
+-
+- /* emit callback which is set by ivi-layout api user */
+- wl_signal_emit(&layout->surface_notification.configure_changed,
+- ivisurf);
+-}
+-
+-struct ivi_layout_surface*
+-ivi_layout_surface_create(struct weston_surface *wl_surface,
+- uint32_t id_surface)
++static struct ivi_layout_surface*
++surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
+ {
+ struct ivi_layout *layout = get_instance();
+ struct ivi_layout_surface *ivisurf = NULL;
+@@ -2018,14 +2006,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
+ return NULL;
+ }
+
+- ivisurf = get_surface(&layout->surface_list, id_surface);
+- if (ivisurf != NULL) {
+- if (ivisurf->surface != NULL) {
+- weston_log("id_surface(%d) is already created\n", id_surface);
+- return NULL;
+- }
+- }
+-
+ ivisurf = calloc(1, sizeof *ivisurf);
+ if (ivisurf == NULL) {
+ weston_log("fails to allocate memory\n");
+@@ -2049,7 +2029,55 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
+
+ wl_list_insert(&layout->surface_list, &ivisurf->link);
+
+- wl_signal_emit(&layout->surface_notification.created, ivisurf);
++ return ivisurf;
++}
++
++void
++ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height)
++{
++ struct ivi_layout *layout = get_instance();
++
++ /* emit callback which is set by ivi-layout api user */
++ wl_signal_emit(&layout->surface_notification.configure_desktop_changed,
++ ivisurf);
++}
++
++struct ivi_layout_surface*
++ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface)
++{
++ return surface_create(wl_surface, id_surface);
++}
++
++void
++ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height)
++{
++ struct ivi_layout *layout = get_instance();
++
++ /* emit callback which is set by ivi-layout api user */
++ wl_signal_emit(&layout->surface_notification.configure_changed,
++ ivisurf);
++}
++
++struct ivi_layout_surface*
++ivi_layout_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface)
++{
++ struct ivi_layout *layout = get_instance();
++ struct ivi_layout_surface *ivisurf = NULL;
++
++ ivisurf = get_surface(&layout->surface_list, id_surface);
++ if (ivisurf) {
++ weston_log("id_surface(%d) is already created\n", id_surface);
++ return NULL;
++ }
++
++ ivisurf = surface_create(wl_surface, id_surface);
++
++ if (ivisurf)
++ wl_signal_emit(&layout->surface_notification.created, ivisurf);
+
+ return ivisurf;
+ }
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch
new file mode 100644
index 000000000..9286ba00b
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch
@@ -0,0 +1,74 @@
+diff --git a/Makefile.am b/Makefile.am
+index cdf82ab4..d990d400 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -993,6 +993,7 @@ ivi_shell_la_LDFLAGS = -module -avoid-version
+ ivi_shell_la_LIBADD = \
+ libshared.la \
+ libweston-@LIBWESTON_MAJOR@.la \
++ libweston-desktop-@LIBWESTON_MAJOR@.la \
+ $(COMPOSITOR_LIBS)
+ ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
+ ivi_shell_la_SOURCES = \
+diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
+index fe5be01a..c054130b 100644
+--- a/ivi-shell/ivi-layout-private.h
++++ b/ivi-shell/ivi-layout-private.h
+@@ -30,6 +30,7 @@
+
+ #include "compositor.h"
+ #include "ivi-layout-export.h"
++#include "libweston-desktop/libweston-desktop.h"
+
+ struct ivi_layout_view {
+ struct wl_list link; /* ivi_layout::view_list */
+@@ -52,6 +53,7 @@ struct ivi_layout_surface {
+
+ struct ivi_layout *layout;
+ struct weston_surface *surface;
++ struct weston_desktop_surface *weston_desktop_surface;
+
+ struct ivi_layout_surface_properties prop;
+
+diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
+index f3156d35..84db2c97 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -44,7 +44,7 @@
+
+ #include "ivi-shell.h"
+ #include "ivi-application-server-protocol.h"
+-#include "ivi-layout-export.h"
++#include "ivi-layout-private.h"
+ #include "ivi-layout-shell.h"
+ #include "shared/helpers.h"
+ #include "compositor/weston.h"
+@@ -271,6 +271,8 @@ application_surface_create(struct wl_client *client,
+ return;
+ }
+
++ layout_surface->weston_desktop_surface = NULL;
++
+ ivisurf = zalloc(sizeof *ivisurf);
+ if (ivisurf == NULL) {
+ wl_resource_post_no_memory(resource);
+diff --git a/ivi-shell/ivi-shell.h b/ivi-shell/ivi-shell.h
+index e35f75f2..be430853 100644
+--- a/ivi-shell/ivi-shell.h
++++ b/ivi-shell/ivi-shell.h
+@@ -30,6 +30,7 @@
+ #include <stdint.h>
+
+ #include "compositor.h"
++#include "libweston-desktop/libweston-desktop.h"
+
+ struct ivi_shell
+ {
+@@ -37,6 +38,7 @@ struct ivi_shell
+
+ struct weston_compositor *compositor;
+
++ struct weston_desktop *desktop;
+ struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */
+
+ struct text_backend *text_backend;
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch
new file mode 100644
index 000000000..e53a8c458
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch
@@ -0,0 +1,30 @@
+index 086d0fd2..6b854503 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -153,7 +153,10 @@ ivi_view_destroy(struct ivi_layout_view *ivi_view)
+ wl_list_remove(&ivi_view->pending_link);
+ wl_list_remove(&ivi_view->order_link);
+
+- weston_view_destroy(ivi_view->view);
++ if (weston_surface_is_desktop_surface(ivi_view->ivisurf->surface))
++ weston_desktop_surface_unlink_view(ivi_view->view);
++ else
++ weston_view_destroy(ivi_view->view);
+
+ free(ivi_view);
+ }
+@@ -170,7 +173,13 @@ ivi_view_create(struct ivi_layout_layer *ivilayer,
+ return NULL;
+ }
+
+- ivi_view->view = weston_view_create(ivisurf->surface);
++ if (weston_surface_is_desktop_surface(ivisurf->surface)) {
++ ivi_view->view = weston_desktop_surface_create_view(
++ ivisurf->weston_desktop_surface);
++ } else {
++ ivi_view->view = weston_view_create(ivisurf->surface);
++ }
++
+ if (ivi_view->view == NULL) {
+ weston_log("fails to allocate memory\n");
+ free(ivi_view);
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
new file mode 100644
index 000000000..6a72f15d8
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
@@ -0,0 +1,166 @@
+index 84db2c97..e797e4f9 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -489,6 +489,162 @@ shell_add_bindings(struct weston_compositor *compositor,
+ shell);
+ }
+
++/*
++ * libweston-desktop
++ */
++
++static void
++desktop_surface_ping_timeout(struct weston_desktop_client *client,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_ping_timeout is not supported\n");
++}
++
++static void
++desktop_surface_pong(struct weston_desktop_client *client,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_pong is not supported\n");
++}
++
++static void
++desktop_surface_added(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ struct ivi_shell *shell = (struct ivi_shell *) user_data;
++ struct ivi_layout_surface *layout_surface;
++ struct ivi_shell_surface *ivisurf;
++ struct weston_surface *weston_surf =
++ weston_desktop_surface_get_surface(surface);
++
++ layout_surface = ivi_layout_desktop_surface_create(weston_surf,
++ IVI_INVALID_ID);
++ if (!layout_surface) {
++ return;
++ }
++
++ layout_surface->weston_desktop_surface = surface;
++
++ ivisurf = zalloc(sizeof *ivisurf);
++ if (!ivisurf) {
++ return;
++ }
++
++ ivisurf->shell = shell;
++ ivisurf->id_surface = IVI_INVALID_ID;
++
++ ivisurf->width = 0;
++ ivisurf->height = 0;
++ ivisurf->layout_surface = layout_surface;
++ ivisurf->surface = weston_surf;
++
++ weston_desktop_surface_set_user_data(surface, ivisurf);
++}
++
++static void
++desktop_surface_removed(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
++ weston_desktop_surface_get_user_data(surface);
++
++ assert(ivisurf != NULL);
++
++ if (ivisurf->layout_surface)
++ layout_surface_cleanup(ivisurf);
++}
++
++static void
++desktop_surface_committed(struct weston_desktop_surface *surface,
++ int32_t sx, int32_t sy, void *user_data)
++{
++ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
++ weston_desktop_surface_get_user_data(surface);
++ struct weston_surface *weston_surf =
++ weston_desktop_surface_get_surface(surface);
++
++ if(!ivisurf)
++ return;
++
++ if (weston_surf->width == 0 || weston_surf->height == 0)
++ return;
++
++ if (ivisurf->width != weston_surf->width ||
++ ivisurf->height != weston_surf->height) {
++ ivisurf->width = weston_surf->width;
++ ivisurf->height = weston_surf->height;
++
++ ivi_layout_desktop_surface_configure(ivisurf->layout_surface,
++ weston_surf->width,
++ weston_surf->height);
++ }
++}
++
++static void
++desktop_surface_move(struct weston_desktop_surface *surface,
++ struct weston_seat *seat, uint32_t serial, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_move is not supported\n");
++}
++
++static void
++desktop_surface_resize(struct weston_desktop_surface *surface,
++ struct weston_seat *seat, uint32_t serial,
++ enum weston_desktop_surface_edge edges, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_resize is not supported\n");
++}
++
++static void
++desktop_surface_fullscreen_requested(struct weston_desktop_surface *surface,
++ bool fullscreen,
++ struct weston_output *output,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_fullscreen_requested is not supported\n");
++}
++
++static void
++desktop_surface_maximized_requested(struct weston_desktop_surface *surface,
++ bool maximized, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_maximized_requested is not supported\n");
++}
++
++static void
++desktop_surface_minimized_requested(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_minimized_requested is not supported\n");
++}
++
++static void
++desktop_surface_set_xwayland_position(struct weston_desktop_surface *surface,
++ int32_t x, int32_t y, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_set_xwayland_position is not supported\n");
++}
++
++static const struct weston_desktop_api shell_desktop_api = {
++ .struct_size = sizeof(struct weston_desktop_api),
++ .ping_timeout = desktop_surface_ping_timeout,
++ .pong = desktop_surface_pong,
++ .surface_added = desktop_surface_added,
++ .surface_removed = desktop_surface_removed,
++ .committed = desktop_surface_committed,
++
++ .move = desktop_surface_move,
++ .resize = desktop_surface_resize,
++ .fullscreen_requested = desktop_surface_fullscreen_requested,
++ .maximized_requested = desktop_surface_maximized_requested,
++ .minimized_requested = desktop_surface_minimized_requested,
++ .set_xwayland_position = desktop_surface_set_xwayland_position,
++};
++
++/*
++ * end of libweston-desktop
++ */
++
+ /*
+ * Initialization of ivi-shell.
+ */
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch
new file mode 100644
index 000000000..b76c35d4f
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch
@@ -0,0 +1,24 @@
+index e797e4f9..5f64e72d 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -162,6 +162,10 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
+ {
+ assert(ivisurf->layout_surface != NULL);
+
++ /* destroy weston_surface destroy signal. */
++ if (!ivisurf->layout_surface->weston_desktop_surface)
++ wl_list_remove(&ivisurf->surface_destroy_listener.link);
++
+ ivi_layout_surface_destroy(ivisurf->layout_surface);
+ ivisurf->layout_surface = NULL;
+
+@@ -169,9 +173,6 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
+ ivisurf->surface->committed_private = NULL;
+ weston_surface_set_label_func(ivisurf->surface, NULL);
+ ivisurf->surface = NULL;
+-
+- // destroy weston_surface destroy signal.
+- wl_list_remove(&ivisurf->surface_destroy_listener.link);
+ }
+
+ /*
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch
new file mode 100644
index 000000000..551e449ad
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch
@@ -0,0 +1,34 @@
+index 5f64e72d..dc8e6f1d 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -677,10 +677,14 @@ wet_shell_init(struct weston_compositor *compositor,
+ if (!shell->text_backend)
+ goto err_settings;
+
++ shell->desktop = weston_desktop_create(compositor, &shell_desktop_api, shell);
++ if (!shell->desktop)
++ goto err_text_backend;
++
+ if (wl_global_create(compositor->wl_display,
+ &ivi_application_interface, 1,
+ shell, bind_ivi_application) == NULL)
+- goto err_text_backend;
++ goto err_desktop;
+
+ ivi_layout_init_with_compositor(compositor);
+ /* TODO ivi_layout_destroy should be implemented, since multiple lists
+@@ -690,10 +694,13 @@ wet_shell_init(struct weston_compositor *compositor,
+ /* Call module_init of ivi-modules which are defined in weston.ini */
+ if (load_controller_modules(compositor, setting.ivi_module,
+ argc, argv) < 0)
+- goto err_text_backend;
++ goto err_desktop;
+
+ return IVI_SUCCEEDED;
+
++err_desktop:
++ weston_desktop_destroy(shell->desktop);
++
+ err_text_backend:
+ text_backend_destroy(shell->text_backend);
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch
new file mode 100644
index 000000000..c5d85bb17
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch
@@ -0,0 +1,133 @@
+index d5403e06..7b2f2707 100644
+--- a/ivi-shell/hmi-controller.c
++++ b/ivi-shell/hmi-controller.c
+@@ -129,9 +129,9 @@ struct hmi_controller {
+ struct weston_compositor *compositor;
+ struct wl_listener destroy_listener;
+
+- struct wl_listener surface_created;
+ struct wl_listener surface_removed;
+ struct wl_listener surface_configured;
++ struct wl_listener desktop_surface_configured;
+
+ struct wl_client *user_interface;
+ struct ui_setting ui_setting;
+@@ -581,28 +581,6 @@ create_layer(struct weston_output *output,
+ /**
+ * Internal set notification
+ */
+-static void
+-set_notification_create_surface(struct wl_listener *listener, void *data)
+-{
+- struct hmi_controller *hmi_ctrl =
+- wl_container_of(listener, hmi_ctrl,
+- surface_created);
+- struct ivi_layout_surface *ivisurf = data;
+- struct hmi_controller_layer *layer_link =
+- wl_container_of(hmi_ctrl->application_layer_list.prev,
+- layer_link,
+- link);
+- struct ivi_layout_layer *application_layer = layer_link->ivilayer;
+- int32_t ret = 0;
+-
+- /* skip ui widgets */
+- if (is_surf_in_ui_widget(hmi_ctrl, ivisurf))
+- return;
+-
+- ret = ivi_layout_interface->layer_add_surface(application_layer, ivisurf);
+- assert(!ret);
+-}
+-
+ static void
+ set_notification_remove_surface(struct wl_listener *listener, void *data)
+ {
+@@ -670,6 +648,42 @@ set_notification_configure_surface(struct wl_listener *listener, void *data)
+ switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
+ }
+
++static void
++set_notification_configure_desktop_surface(struct wl_listener *listener, void *data)
++{
++ struct hmi_controller *hmi_ctrl =
++ wl_container_of(listener, hmi_ctrl,
++ desktop_surface_configured);
++ struct ivi_layout_surface *ivisurf = data;
++ struct hmi_controller_layer *layer_link =
++ wl_container_of(hmi_ctrl->application_layer_list.prev,
++ layer_link,
++ link);
++ struct ivi_layout_layer *application_layer = layer_link->ivilayer;
++ struct weston_surface *surface;
++ int32_t ret = 0;
++
++ /* skip ui widgets */
++ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf))
++ return;
++
++ ret = ivi_layout_interface->layer_add_surface(application_layer, ivisurf);
++ assert(!ret);
++
++ /*
++ * if application changes size of wl_buffer. The source rectangle shall be
++ * fit to the size.
++ */
++ surface = ivi_layout_interface->surface_get_weston_surface(ivisurf);
++ if (surface) {
++ ivi_layout_interface->surface_set_source_rectangle(ivisurf, 0,
++ 0, surface->width, surface->height);
++ }
++
++ ivi_layout_interface->commit_changes();
++ switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
++}
++
+ /**
+ * A hmi_controller used 4 ivi_layers to manage ivi_surfaces. The IDs of
+ * corresponding ivi_layer are defined in weston.ini. Default scene graph
+@@ -852,6 +866,9 @@ hmi_controller_create(struct weston_compositor *ec)
+ hmi_ctrl->surface_configured.notify = set_notification_configure_surface;
+ ivi_layout_interface->add_listener_configure_surface(&hmi_ctrl->surface_configured);
+
++ hmi_ctrl->desktop_surface_configured.notify = set_notification_configure_desktop_surface;
++ ivi_layout_interface->add_listener_configure_desktop_surface(&hmi_ctrl->desktop_surface_configured);
++
+ hmi_ctrl->destroy_listener.notify = hmi_controller_destroy;
+ wl_signal_add(&hmi_ctrl->compositor->destroy_signal,
+ &hmi_ctrl->destroy_listener);
+@@ -1275,13 +1292,6 @@ ivi_hmi_controller_UI_ready(struct wl_client *client,
+ ivi_layout_interface->commit_changes();
+
+ ivi_hmi_controller_add_launchers(hmi_ctrl, 256);
+-
+- /* Add surface_created listener after the initialization of launchers.
+- * Otherwise, surfaces of the launchers will be added to application
+- * layer too.*/
+- hmi_ctrl->surface_created.notify = set_notification_create_surface;
+- ivi_layout_interface->add_listener_create_surface(&hmi_ctrl->surface_created);
+-
+ hmi_ctrl->is_initialized = 1;
+ }
+
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 6b854503..22d63708 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -787,9 +787,15 @@ commit_surface_list(struct ivi_layout *layout)
+ ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
+
+ if (configured && !is_surface_transition(ivisurf)) {
+- shell_surface_send_configure(ivisurf->surface,
+- ivisurf->prop.dest_width,
+- ivisurf->prop.dest_height);
++ if (ivisurf->weston_desktop_surface) {
++ weston_desktop_surface_set_size(ivisurf->weston_desktop_surface,
++ ivisurf->prop.dest_width,
++ ivisurf->prop.dest_height);
++ } else {
++ shell_surface_send_configure(ivisurf->surface,
++ ivisurf->prop.dest_width,
++ ivisurf->prop.dest_height);
++ }
+ }
+ } else {
+ configured = 0;
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch
new file mode 100644
index 000000000..8094f9b85
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch
@@ -0,0 +1,164 @@
+index 23f79dfe..f9c8010b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -616,9 +616,7 @@ demo_clients += weston-simple-egl
+ weston_simple_egl_SOURCES = clients/simple-egl.c
+ nodist_weston_simple_egl_SOURCES = \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+- protocol/xdg-shell-unstable-v6-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h
++ protocol/xdg-shell-unstable-v6-client-protocol.h
+ weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
+ weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
+ endif
+diff --git a/clients/simple-egl.c b/clients/simple-egl.c
+index dad0f09b..07e7e785 100644
+--- a/clients/simple-egl.c
++++ b/clients/simple-egl.c
+@@ -45,8 +45,6 @@
+ #include "xdg-shell-unstable-v6-client-protocol.h"
+ #include <sys/types.h>
+ #include <unistd.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+
+ #include "shared/helpers.h"
+ #include "shared/platform.h"
+@@ -74,7 +72,6 @@ struct display {
+ EGLConfig conf;
+ } egl;
+ struct window *window;
+- struct ivi_application *ivi_application;
+
+ PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
+ };
+@@ -97,7 +94,6 @@ struct window {
+ struct wl_surface *surface;
+ struct zxdg_surface_v6 *xdg_surface;
+ struct zxdg_toplevel_v6 *xdg_toplevel;
+- struct ivi_surface *ivi_surface;
+ EGLSurface egl_surface;
+ struct wl_callback *callback;
+ int fullscreen, opaque, buffer_size, frame_sync, delay;
+@@ -355,27 +351,22 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
+ };
+
+ static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
++create_surface(struct window *window)
+ {
+- struct window *window = data;
+-
+- wl_egl_window_resize(window->native, width, height, 0, 0);
+-
+- window->geometry.width = width;
+- window->geometry.height = height;
++ struct display *display = window->display;
++ EGLBoolean ret;
+
+- if (!window->fullscreen)
+- window->window_size = window->geometry;
+-}
++ window->surface = wl_compositor_create_surface(display->compositor);
+
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
++ window->native =
++ wl_egl_window_create(window->surface,
++ window->geometry.width,
++ window->geometry.height);
++ window->egl_surface =
++ weston_platform_create_egl_surface(display->egl.dpy,
++ display->egl.conf,
++ window->native, NULL);
+
+-static void
+-create_xdg_surface(struct window *window, struct display *display)
+-{
+ window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
+ window->surface);
+ zxdg_surface_v6_add_listener(window->xdg_surface,
+@@ -390,50 +381,6 @@ create_xdg_surface(struct window *window, struct display *display)
+
+ window->wait_for_configure = true;
+ wl_surface_commit(window->surface);
+-}
+-
+-static void
+-create_ivi_surface(struct window *window, struct display *display)
+-{
+- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->surface);
+-
+- if (window->ivi_surface == NULL) {
+- fprintf(stderr, "Failed to create ivi_client_surface\n");
+- abort();
+- }
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+-}
+-
+-static void
+-create_surface(struct window *window)
+-{
+- struct display *display = window->display;
+- EGLBoolean ret;
+-
+- window->surface = wl_compositor_create_surface(display->compositor);
+-
+- window->native =
+- wl_egl_window_create(window->surface,
+- window->geometry.width,
+- window->geometry.height);
+- window->egl_surface =
+- weston_platform_create_egl_surface(display->egl.dpy,
+- display->egl.conf,
+- window->native, NULL);
+-
+-
+- if (display->shell) {
+- create_xdg_surface(window, display);
+- } else if (display->ivi_application ) {
+- create_ivi_surface(window, display);
+- } else {
+- assert(0);
+- }
+
+ ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
+ window->egl_surface, window->display->egl.ctx);
+@@ -465,8 +412,6 @@ destroy_surface(struct window *window)
+ zxdg_toplevel_v6_destroy(window->xdg_toplevel);
+ if (window->xdg_surface)
+ zxdg_surface_v6_destroy(window->xdg_surface);
+- if (window->display->ivi_application)
+- ivi_surface_destroy(window->ivi_surface);
+ wl_surface_destroy(window->surface);
+
+ if (window->callback)
+@@ -821,10 +766,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
+ fprintf(stderr, "unable to load default left pointer\n");
+ // TODO: abort ?
+ }
+- } else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, name,
+- &ivi_application_interface, 1);
+ }
+ }
+
+@@ -939,9 +880,6 @@ main(int argc, char **argv)
+ if (display.shell)
+ zxdg_shell_v6_destroy(display.shell);
+
+- if (display.ivi_application)
+- ivi_application_destroy(display.ivi_application);
+-
+ if (display.compositor)
+ wl_compositor_destroy(display.compositor);
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch
new file mode 100644
index 000000000..495e50ca2
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch
@@ -0,0 +1,107 @@
+index f9c8010b..c37cd00b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -574,9 +574,7 @@ nodist_weston_simple_shm_SOURCES = \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+ protocol/xdg-shell-unstable-v6-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+- protocol/fullscreen-shell-unstable-v1-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h
++ protocol/fullscreen-shell-unstable-v1-client-protocol.h
+ weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
+ weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
+
+diff --git a/clients/simple-shm.c b/clients/simple-shm.c
+index 9fa2e214..fc2ef001 100644
+--- a/clients/simple-shm.c
++++ b/clients/simple-shm.c
+@@ -40,10 +40,6 @@
+ #include "xdg-shell-unstable-v6-client-protocol.h"
+ #include "fullscreen-shell-unstable-v1-client-protocol.h"
+
+-#include <sys/types.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+-
+ struct display {
+ struct wl_display *display;
+ struct wl_registry *registry;
+@@ -52,7 +48,6 @@ struct display {
+ struct zwp_fullscreen_shell_v1 *fshell;
+ struct wl_shm *shm;
+ bool has_xrgb;
+- struct ivi_application *ivi_application;
+ };
+
+ struct buffer {
+@@ -67,7 +62,6 @@ struct window {
+ struct wl_surface *surface;
+ struct zxdg_surface_v6 *xdg_surface;
+ struct zxdg_toplevel_v6 *xdg_toplevel;
+- struct ivi_surface *ivi_surface;
+ struct buffer buffers[2];
+ struct buffer *prev_buffer;
+ struct wl_callback *callback;
+@@ -165,17 +159,6 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
+ handle_xdg_toplevel_close,
+ };
+
+-static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
+-{
+- /* Simple-shm is resizable */
+-}
+-
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
+-
+ static struct window *
+ create_window(struct display *display, int width, int height)
+ {
+@@ -213,19 +196,6 @@ create_window(struct display *display, int width, int height)
+ window->surface,
+ ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
+ NULL);
+- } else if (display->ivi_application ) {
+- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->surface);
+- if (window->ivi_surface == NULL) {
+- fprintf(stderr, "Failed to create ivi_client_surface\n");
+- abort();
+- }
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+-
+ } else {
+ assert(0);
+ }
+@@ -407,11 +377,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
+ id, &wl_shm_interface, 1);
+ wl_shm_add_listener(d->shm, &shm_listener, d);
+ }
+- else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, id,
+- &ivi_application_interface, 1);
+- }
+ }
+
+ static void
+@@ -555,11 +520,6 @@ main(int argc, char **argv)
+
+ fprintf(stderr, "simple-shm exiting\n");
+
+- if (window->display->ivi_application) {
+- ivi_surface_destroy(window->ivi_surface);
+- ivi_application_destroy(window->display->ivi_application);
+- }
+-
+ destroy_window(window);
+ destroy_display(display);
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch
new file mode 100644
index 000000000..f3d2fe47f
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch
@@ -0,0 +1,130 @@
+index c37cd00b..f30ddbe9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -665,8 +665,6 @@ nodist_libtoytoolkit_la_SOURCES = \
+ protocol/viewporter-client-protocol.h \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+ protocol/xdg-shell-unstable-v6-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h \
+ protocol/pointer-constraints-unstable-v1-protocol.c \
+ protocol/pointer-constraints-unstable-v1-client-protocol.h \
+ protocol/relative-pointer-unstable-v1-protocol.c \
+diff --git a/clients/window.c b/clients/window.c
+index 95796d46..aac43abd 100644
+--- a/clients/window.c
++++ b/clients/window.c
+@@ -82,10 +82,6 @@ typedef void *EGLContext;
+
+ #include "window.h"
+
+-#include <sys/types.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+-
+ #define ZWP_RELATIVE_POINTER_MANAGER_V1_VERSION 1
+ #define ZWP_POINTER_CONSTRAINTS_V1_VERSION 1
+
+@@ -107,7 +103,6 @@ struct display {
+ struct wl_data_device_manager *data_device_manager;
+ struct text_cursor_position *text_cursor_position;
+ struct zxdg_shell_v6 *xdg_shell;
+- struct ivi_application *ivi_application; /* ivi style shell */
+ struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
+ struct zwp_pointer_constraints_v1 *pointer_constraints;
+ EGLDisplay dpy;
+@@ -269,8 +264,6 @@ struct window {
+ struct window *parent;
+ struct window *last_parent;
+
+- struct ivi_surface *ivi_surface;
+-
+ struct window_frame *frame;
+
+ /* struct surface::link, contains also main_surface */
+@@ -1441,19 +1434,6 @@ window_get_display(struct window *window)
+ return window->display;
+ }
+
+-static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
+-{
+- struct window *window = data;
+-
+- window_schedule_resize(window, width, height);
+-}
+-
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
+-
+ static void
+ surface_create_surface(struct surface *surface, uint32_t flags)
+ {
+@@ -1604,9 +1584,6 @@ window_destroy(struct window *window)
+ if (window->xdg_surface)
+ zxdg_surface_v6_destroy(window->xdg_surface);
+
+- if (window->ivi_surface)
+- ivi_surface_destroy(window->ivi_surface);
+-
+ surface_destroy(window->main_surface);
+
+ wl_list_remove(&window->link);
+@@ -5200,7 +5177,7 @@ window_create_internal(struct display *display, int custom)
+ surface = surface_create(window);
+ window->main_surface = surface;
+
+- assert(custom || display->xdg_shell || display->ivi_application);
++ assert(custom || display->xdg_shell);
+
+ window->custom = custom;
+ window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE;
+@@ -5220,7 +5197,6 @@ struct window *
+ window_create(struct display *display)
+ {
+ struct window *window;
+- uint32_t id_ivisurf;
+
+ window = window_create_internal(display, 0);
+
+@@ -5243,16 +5219,6 @@ window_create(struct display *display)
+ window_inhibit_redraw(window);
+
+ wl_surface_commit(window->main_surface->surface);
+- } else if (display->ivi_application) {
+- /* auto generation of ivi_id based on process id + basement of id */
+- id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->main_surface->surface);
+- fail_on_null(window->ivi_surface, 0, __FILE__, __LINE__);
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+ }
+
+ return window;
+@@ -6013,11 +5979,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
+ wl_registry_bind(registry, id,
+ &wl_subcompositor_interface, 1);
+ }
+- else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, id,
+- &ivi_application_interface, 1);
+- }
+
+ if (d->global_handler)
+ d->global_handler(d, id, interface, version, d->user_data);
+@@ -6316,9 +6277,6 @@ display_destroy(struct display *display)
+ if (display->xdg_shell)
+ zxdg_shell_v6_destroy(display->xdg_shell);
+
+- if (display->ivi_application)
+- ivi_application_destroy(display->ivi_application);
+-
+ if (display->shm)
+ wl_shm_destroy(display->shm);
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch
new file mode 100644
index 000000000..3e85e93f6
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch
@@ -0,0 +1,82 @@
+From deee858b0b199d8cfa8033a46d7078f30b23725e Mon Sep 17 00:00:00 2001
+From: "Ucan, Emre (ADITG/SW1)" <eucan@de.adit-jv.com>
+Date: Thu, 2 Mar 2017 08:47:33 +0000
+Subject: ivi-shell: add_screen_remove_layer API
+
+It is analagous to layer_remove_surface API.
+The API removes a layer from the render order
+of the screen.
+
+v3:
+add the new vfunc at the end of
+the ivi_layout_interface struct.
+
+Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
+Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
+Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
+diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
+index 2317d6e..39ffde1 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -578,6 +578,16 @@ struct ivi_layout_interface {
+ */
+ struct ivi_layout_surface *
+ (*get_surface)(struct weston_surface *surface);
++
++ /**
++ * \brief Remove a ivi_layer to a weston_output which is currently managed
++ * by the service
++ *
++ * \return IVI_SUCCEEDED if the method call was successful
++ * \return IVI_FAILED if the method call was failed
++ */
++ int32_t (*screen_remove_layer)(struct weston_output *output,
++ struct ivi_layout_layer *removelayer);
+ };
+
+ #ifdef __cplusplus
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 298e18e..8e4280b 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1664,6 +1664,27 @@ ivi_layout_screen_add_layer(struct weston_output *output,
+ }
+
+ static int32_t
++ivi_layout_screen_remove_layer(struct weston_output *output,
++ struct ivi_layout_layer *removelayer)
++{
++ struct ivi_layout_screen *iviscrn;
++
++ if (output == NULL || removelayer == NULL) {
++ weston_log("ivi_layout_screen_remove_layer: invalid argument\n");
++ return IVI_FAILED;
++ }
++
++ iviscrn = get_screen_from_output(output);
++
++ wl_list_remove(&removelayer->pending.link);
++ wl_list_init(&removelayer->pending.link);
++
++ iviscrn->order.dirty = 1;
++
++ return IVI_SUCCEEDED;
++}
++
++static int32_t
+ ivi_layout_screen_set_render_order(struct weston_output *output,
+ struct ivi_layout_layer **pLayer,
+ const int32_t number)
+@@ -2088,6 +2109,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ */
+ .get_screens_under_layer = ivi_layout_get_screens_under_layer,
+ .screen_add_layer = ivi_layout_screen_add_layer,
++ .screen_remove_layer = ivi_layout_screen_remove_layer,
+ .screen_set_render_order = ivi_layout_screen_set_render_order,
+
+ /**
+--
+cgit v0.10.2
+
+