[PATCH weston 3/4] shell: Use pid when binding the client shell
Tiago Vignatti
tiago.vignatti at intel.com
Thu Apr 4 14:07:39 PDT 2013
If a shell client decides to call wl_display_connect more than once and only
later bind the desktop_shell interface, then the logic that uses the client
pointer fails, because the current client trying to connect won't match with
the first one assigned there.
In special, GTK+ is connecting twice every time one application is starting.
It checks whether a connection to the default display server is possible
during initialisation and fail otherwise:
https://bugzilla.gnome.org/show_bug.cgi?id=694465
I'm afraid we'll want to change the weston_client_launch API to return the PID
instead, and change the logic in all the callers.
Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
src/shell.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shell.c b/src/shell.c
index 246d342..f23b855 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3397,12 +3397,14 @@ bind_desktop_shell(struct wl_client *client,
{
struct desktop_shell *shell = data;
struct wl_resource *resource;
+ pid_t pid;
resource = wl_client_add_object(client, &desktop_shell_interface,
&desktop_shell_implementation,
id, shell);
- if (client == shell->child.client) {
+ wl_client_get_credentials(client, &pid, NULL, NULL);
+ if (pid == shell->child.process.pid || pid == getpid()) {
resource->destroy = unbind_desktop_shell;
shell->child.desktop_shell = resource;
return;
--
1.7.9.5
More information about the wayland-devel
mailing list