weston_client_launch() might return a client pointer that will not be the
actual one the shell client is binding. Therefore, assign the pointer only
later after the interface is already bound.

Signed-off-by: Tiago Vignatti <tiago.vigna...@intel.com>
---
 src/shell.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index f23b855..0365ba6 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3360,12 +3360,8 @@ launch_desktop_shell_process(void *data)
 {
        struct desktop_shell *shell = data;
 
-       shell->child.client = weston_client_launch(shell->compositor,
-                                                &shell->child.process,
-                                                shell->child.path,
-                                                desktop_shell_sigchld);
-
-       if (!shell->child.client)
+       if (!weston_client_launch(shell->compositor, &shell->child.process,
+                                  shell->child.path, desktop_shell_sigchld))
                weston_log("not able to start %s\n", shell->child.path);
 }
 
@@ -3405,6 +3401,7 @@ bind_desktop_shell(struct wl_client *client,
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
        if (pid == shell->child.process.pid || pid == getpid()) {
+               shell->child.client = client;
                resource->destroy = unbind_desktop_shell;
                shell->child.desktop_shell = resource;
                return;
-- 
1.7.9.5

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to