From ddf0d5d0e83b34a38debf0b160b912fe337308e6 Mon Sep 17 00:00:00 2001 From: Wataru Natsume Date: Fri, 8 Apr 2016 10:54:06 +0900 Subject: [PATCH] Send process ID that created surface to client. createPid should be a pid of process that creates surface. This patch is ported from Genivi. Add null check of surface. Change-Id: I28fdf7ccb1f9f95a40521aed955713bf90300c2d Signed-off-by: Wataru Natsume --- ...process-ID-that-created-surface-to-client.patch | 43 ++++++++++++++++++++++ .../wayland/wayland-ivi-extension_1.5.0.bbappend | 7 ++++ 2 files changed, 50 insertions(+) create mode 100644 meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Send-process-ID-that-created-surface-to-client.patch create mode 100644 meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Send-process-ID-that-created-surface-to-client.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Send-process-ID-that-created-surface-to-client.patch new file mode 100644 index 000000000..5c29d90e2 --- /dev/null +++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Send-process-ID-that-created-surface-to-client.patch @@ -0,0 +1,43 @@ +From f4adf64d979944aa80f1ba5dba4ed991b6620162 Mon Sep 17 00:00:00 2001 +From: Wataru Natsume +Date: Tue, 23 Feb 2016 11:14:53 +0900 +Subject: [PATCH] ivi-controller: Send process ID that created surface to + client. + +createPid should be a pid of process that creates surface. + +Signed-off-by: Wataru Natsume +--- + weston-ivi-shell/src/ivi-controller-impl.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c +index f4e29ce..57bf5cc 100644 +--- a/weston-ivi-shell/src/ivi-controller-impl.c ++++ b/weston-ivi-shell/src/ivi-controller-impl.c +@@ -603,10 +603,21 @@ controller_surface_send_stats(struct wl_client *client, + struct wl_resource *resource) + { + struct ivisurface *ivisurf = wl_resource_get_user_data(resource); ++ struct weston_surface *surface; ++ struct wl_client* target_client; + pid_t pid; + uid_t uid; + gid_t gid; +- wl_client_get_credentials(client, &pid, &uid, &gid); ++ ++ /* Get pid that created surface */ ++ surface = ivi_extension_surface_get_weston_surface(ivisurf->shell, ++ ivisurf->layout_surface); ++ if (!surface) ++ return; ++ ++ target_client = wl_resource_get_client(surface->resource); ++ ++ wl_client_get_credentials(target_client, &pid, &uid, &gid); + + ivi_controller_surface_send_stats(resource, 0, 0, + ivisurf->update_count, pid, ""); +-- +1.8.3.1 + diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend new file mode 100644 index 000000000..f68ba713d --- /dev/null +++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:" + + +SRC_URI_append = " \ + file://0001-Send-process-ID-that-created-surface-to-client.patch \ + " + -- 2.16.6