diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2013-04-18 16:47:31 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-05-02 16:41:48 -0400 |
commit | b41531a88ea79376560f11e3ec488cfa8b9e3ef3 (patch) | |
tree | 58f0cc0f85acb4846110c68987e366620726a066 /src/text-backend.c | |
parent | 7cd29e199ac3fca57c84be021c36f9019cfa7b92 (diff) |
text: Only allow input-method started by weston to bind
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'src/text-backend.c')
-rw-r--r-- | src/text-backend.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/text-backend.c b/src/text-backend.c index 07a066c..53aa92c 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -759,17 +759,24 @@ bind_input_method(struct wl_client *client, NULL, id, input_method); - if (input_method->input_method_binding == NULL) { - resource->destroy = unbind_input_method; - input_method->input_method_binding = resource; + if (input_method->input_method_binding != NULL) { + wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, + "interface object already bound"); + wl_resource_destroy(resource); + return; + } - text_backend->input_method.binding = resource; + if (text_backend->input_method.client != client) { + wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, + "permission to bind desktop_shell denied"); + wl_resource_destroy(resource); return; } - wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, - "interface object already bound"); - wl_resource_destroy(resource); + resource->destroy = unbind_input_method; + input_method->input_method_binding = resource; + + text_backend->input_method.binding = resource; } static void |