From 93652645f2fbd65c5b01cf32616d2dd1cbcd7af3 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 15 Nov 2017 16:33:16 +0000 Subject: Added XDG compatibility to ivi-shell Backported M.Teyfel patch from wayland-devel mailing list: https://lists.freedesktop.org/archives/wayland-devel/2017-November/035700.html Upgrade wayland-ivi-extension to v2.0.2 but keep using 1.1x for now with PREFERRED_VERSION until HMI could use the new version. Added Emre Ucan simple-id-agent to review. Bug-AGL: SPEC-1096 Change-Id: I74c4ae0bf0bf822e27dcbb193dc9f7a13d3e270d Signed-off-by: Romain Forlot Reviewed-on: https://gerrit.automotivelinux.org/gerrit/11991 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account Reviewed-by: Nobuhiko Tanibata Reviewed-by: Tadao Tanikawa Reviewed-by: Jan-Simon Moeller --- ...r-register-for-desktop_surface_configured.patch | 133 +++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch (limited to 'meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch') diff --git a/meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch b/meta-agl/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/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; -- cgit 1.2.3-korg