text: Add commit request

Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
Jan Arne Petersen
2013-01-31 15:52:20 +01:00
committed by Kristian Høgsberg
parent f255165bd4
commit 0eabcaafae
6 changed files with 53 additions and 13 deletions
+16 -1
View File
@@ -257,6 +257,20 @@ text_model_invoke_action(struct wl_client *client,
}
}
static void
text_model_commit(struct wl_client *client,
struct wl_resource *resource)
{
struct text_model *text_model = resource->data;
struct input_method *input_method, *next;
wl_list_for_each_safe(input_method, next, &text_model->input_methods, link) {
if (!input_method->context)
continue;
input_method_context_send_commit(&input_method->context->resource);
}
}
static const struct text_model_interface text_model_implementation = {
text_model_set_surrounding_text,
text_model_activate,
@@ -264,7 +278,8 @@ static const struct text_model_interface text_model_implementation = {
text_model_reset,
text_model_set_micro_focus,
text_model_set_content_type,
text_model_invoke_action
text_model_invoke_action,
text_model_commit
};
static void text_model_factory_create_text_model(struct wl_client *client,