text: Only allow input-method started by weston to bind
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
parent
7cd29e199a
commit
b41531a88e
@ -759,17 +759,24 @@ bind_input_method(struct wl_client *client,
|
|||||||
NULL,
|
NULL,
|
||||||
id, input_method);
|
id, input_method);
|
||||||
|
|
||||||
if (input_method->input_method_binding == NULL) {
|
if (input_method->input_method_binding != NULL) {
|
||||||
resource->destroy = unbind_input_method;
|
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
input_method->input_method_binding = resource;
|
"interface object already bound");
|
||||||
|
wl_resource_destroy(resource);
|
||||||
text_backend->input_method.binding = resource;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
|
if (text_backend->input_method.client != client) {
|
||||||
"interface object already bound");
|
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
wl_resource_destroy(resource);
|
"permission to bind desktop_shell denied");
|
||||||
|
wl_resource_destroy(resource);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
resource->destroy = unbind_input_method;
|
||||||
|
input_method->input_method_binding = resource;
|
||||||
|
|
||||||
|
text_backend->input_method.binding = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user