Send process ID that created surface to client.
[AGL/meta-agl.git] / meta-ivi-common / recipes-graphics / wayland / wayland-ivi-extension / 0001-Send-process-ID-that-created-surface-to-client.patch
1 From f4adf64d979944aa80f1ba5dba4ed991b6620162 Mon Sep 17 00:00:00 2001
2 From: Wataru Natsume <wnatsume@jp.adit-jv.com>
3 Date: Tue, 23 Feb 2016 11:14:53 +0900
4 Subject: [PATCH] ivi-controller: Send process ID that created surface to
5  client.
6
7 createPid should be a pid of process that creates surface.
8
9 Signed-off-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
10 ---
11  weston-ivi-shell/src/ivi-controller-impl.c | 13 ++++++++++++-
12  1 file changed, 12 insertions(+), 1 deletion(-)
13
14 diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c
15 index f4e29ce..57bf5cc 100644
16 --- a/weston-ivi-shell/src/ivi-controller-impl.c
17 +++ b/weston-ivi-shell/src/ivi-controller-impl.c
18 @@ -603,10 +603,21 @@ controller_surface_send_stats(struct wl_client *client,
19                                struct wl_resource *resource)
20  {
21      struct ivisurface *ivisurf = wl_resource_get_user_data(resource);
22 +    struct weston_surface *surface;
23 +    struct wl_client* target_client;
24      pid_t pid;
25      uid_t uid;
26      gid_t gid;
27 -    wl_client_get_credentials(client, &pid, &uid, &gid);
28 +
29 +    /* Get pid that created surface */
30 +    surface = ivi_extension_surface_get_weston_surface(ivisurf->shell,
31 +                                                       ivisurf->layout_surface);
32 +    if (!surface)
33 +        return;
34 +
35 +    target_client = wl_resource_get_client(surface->resource);
36 +
37 +    wl_client_get_credentials(target_client, &pid, &uid, &gid);
38  
39      ivi_controller_surface_send_stats(resource, 0, 0,
40                                        ivisurf->update_count, pid, "");
41 -- 
42 1.8.3.1
43