text: Rename input_method to wl_input_method
Also rename input_method_context to wl_input_method_context, input_panel to wl_input_panel and input_panel_surface to wl_input_panel_surface. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
2f51d8a2ff
commit
cc75ec11ca
+81
-81
@@ -35,9 +35,9 @@
|
||||
struct keyboard;
|
||||
|
||||
struct virtual_keyboard {
|
||||
struct input_panel *input_panel;
|
||||
struct input_method *input_method;
|
||||
struct input_method_context *context;
|
||||
struct wl_input_panel *input_panel;
|
||||
struct wl_input_method *input_method;
|
||||
struct wl_input_method_context *context;
|
||||
struct display *display;
|
||||
struct output *output;
|
||||
char *preedit_string;
|
||||
@@ -387,11 +387,11 @@ virtual_keyboard_commit_preedit(struct virtual_keyboard *keyboard)
|
||||
strlen(keyboard->preedit_string) == 0)
|
||||
return;
|
||||
|
||||
input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
keyboard->preedit_string);
|
||||
wl_input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
wl_input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
keyboard->preedit_string);
|
||||
free(keyboard->preedit_string);
|
||||
keyboard->preedit_string = strdup("");
|
||||
}
|
||||
@@ -403,18 +403,18 @@ virtual_keyboard_send_preedit(struct virtual_keyboard *keyboard,
|
||||
uint32_t index = strlen(keyboard->preedit_string);
|
||||
|
||||
if (keyboard->preedit_style)
|
||||
input_method_context_preedit_styling(keyboard->context,
|
||||
0,
|
||||
strlen(keyboard->preedit_string),
|
||||
keyboard->preedit_style);
|
||||
wl_input_method_context_preedit_styling(keyboard->context,
|
||||
0,
|
||||
strlen(keyboard->preedit_string),
|
||||
keyboard->preedit_style);
|
||||
if (cursor > 0)
|
||||
index = cursor;
|
||||
input_method_context_preedit_cursor(keyboard->context,
|
||||
index);
|
||||
input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
keyboard->preedit_string,
|
||||
keyboard->preedit_string);
|
||||
wl_input_method_context_preedit_cursor(keyboard->context,
|
||||
index);
|
||||
wl_input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
keyboard->preedit_string,
|
||||
keyboard->preedit_string);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -438,11 +438,11 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
|
||||
break;
|
||||
|
||||
if (strlen(keyboard->keyboard->preedit_string) == 0) {
|
||||
input_method_context_delete_surrounding_text(keyboard->keyboard->context,
|
||||
-1, 1);
|
||||
input_method_context_commit_string(keyboard->keyboard->context,
|
||||
keyboard->keyboard->serial,
|
||||
"");
|
||||
wl_input_method_context_delete_surrounding_text(keyboard->keyboard->context,
|
||||
-1, 1);
|
||||
wl_input_method_context_commit_string(keyboard->keyboard->context,
|
||||
keyboard->keyboard->serial,
|
||||
"");
|
||||
} else {
|
||||
keyboard->keyboard->preedit_string[strlen(keyboard->keyboard->preedit_string) - 1] = '\0';
|
||||
virtual_keyboard_send_preedit(keyboard->keyboard, -1);
|
||||
@@ -450,10 +450,10 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
|
||||
break;
|
||||
case keytype_enter:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Return, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Return, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_space:
|
||||
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
|
||||
@@ -476,38 +476,38 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
|
||||
break;
|
||||
case keytype_tab:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Tab, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Tab, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_arrow_up:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Up, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Up, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_arrow_left:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Left, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Left, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_arrow_right:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Right, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Right, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_arrow_down:
|
||||
virtual_keyboard_commit_preedit(keyboard->keyboard);
|
||||
input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Down, key_state, mod_mask);
|
||||
wl_input_method_context_keysym(keyboard->keyboard->context,
|
||||
display_get_serial(keyboard->keyboard->display),
|
||||
time,
|
||||
XKB_KEY_Down, key_state, mod_mask);
|
||||
break;
|
||||
case keytype_style:
|
||||
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
|
||||
@@ -558,7 +558,7 @@ button_handler(struct widget *widget,
|
||||
|
||||
static void
|
||||
handle_surrounding_text(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
const char *text,
|
||||
uint32_t cursor,
|
||||
uint32_t anchor)
|
||||
@@ -571,7 +571,7 @@ handle_surrounding_text(void *data,
|
||||
|
||||
static void
|
||||
handle_reset(void *data,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
|
||||
@@ -585,7 +585,7 @@ handle_reset(void *data,
|
||||
|
||||
static void
|
||||
handle_content_type(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t hint,
|
||||
uint32_t purpose)
|
||||
{
|
||||
@@ -597,7 +597,7 @@ handle_content_type(void *data,
|
||||
|
||||
static void
|
||||
handle_invoke_action(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t button,
|
||||
uint32_t index)
|
||||
{
|
||||
@@ -611,7 +611,7 @@ handle_invoke_action(void *data,
|
||||
|
||||
static void
|
||||
handle_commit_state(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t serial)
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
@@ -628,15 +628,15 @@ handle_commit_state(void *data,
|
||||
layout->columns * key_width,
|
||||
layout->rows * key_height);
|
||||
|
||||
input_method_context_language(context, keyboard->serial, layout->language);
|
||||
input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
|
||||
wl_input_method_context_language(context, keyboard->serial, layout->language);
|
||||
wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
|
||||
|
||||
widget_schedule_redraw(keyboard->keyboard->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_preferred_language(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
const char *language)
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
@@ -650,7 +650,7 @@ handle_preferred_language(void *data,
|
||||
keyboard->preferred_language = strdup(language);
|
||||
}
|
||||
|
||||
static const struct input_method_context_listener input_method_context_listener = {
|
||||
static const struct wl_input_method_context_listener input_method_context_listener = {
|
||||
handle_surrounding_text,
|
||||
handle_reset,
|
||||
handle_content_type,
|
||||
@@ -661,8 +661,8 @@ static const struct input_method_context_listener input_method_context_listener
|
||||
|
||||
static void
|
||||
input_method_activate(void *data,
|
||||
struct input_method *input_method,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method *input_method,
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
struct wl_array modifiers_map;
|
||||
@@ -671,7 +671,7 @@ input_method_activate(void *data,
|
||||
keyboard->keyboard->state = keyboardstate_default;
|
||||
|
||||
if (keyboard->context)
|
||||
input_method_context_destroy(keyboard->context);
|
||||
wl_input_method_context_destroy(keyboard->context);
|
||||
|
||||
if (keyboard->preedit_string)
|
||||
free(keyboard->preedit_string);
|
||||
@@ -687,15 +687,15 @@ input_method_activate(void *data,
|
||||
keyboard->serial = 0;
|
||||
|
||||
keyboard->context = context;
|
||||
input_method_context_add_listener(context,
|
||||
&input_method_context_listener,
|
||||
keyboard);
|
||||
wl_input_method_context_add_listener(context,
|
||||
&input_method_context_listener,
|
||||
keyboard);
|
||||
|
||||
wl_array_init(&modifiers_map);
|
||||
keysym_modifiers_add(&modifiers_map, "Shift");
|
||||
keysym_modifiers_add(&modifiers_map, "Control");
|
||||
keysym_modifiers_add(&modifiers_map, "Mod1");
|
||||
input_method_context_modifiers_map(context, &modifiers_map);
|
||||
wl_input_method_context_modifiers_map(context, &modifiers_map);
|
||||
keyboard->keysym.shift_mask = keysym_modifiers_get_mask(&modifiers_map, "Shift");
|
||||
wl_array_release(&modifiers_map);
|
||||
|
||||
@@ -705,27 +705,27 @@ input_method_activate(void *data,
|
||||
layout->columns * key_width,
|
||||
layout->rows * key_height);
|
||||
|
||||
input_method_context_language(context, keyboard->serial, layout->language);
|
||||
input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
|
||||
wl_input_method_context_language(context, keyboard->serial, layout->language);
|
||||
wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
|
||||
|
||||
widget_schedule_redraw(keyboard->keyboard->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
input_method_deactivate(void *data,
|
||||
struct input_method *input_method,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method *input_method,
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
|
||||
if (!keyboard->context)
|
||||
return;
|
||||
|
||||
input_method_context_destroy(keyboard->context);
|
||||
wl_input_method_context_destroy(keyboard->context);
|
||||
keyboard->context = NULL;
|
||||
}
|
||||
|
||||
static const struct input_method_listener input_method_listener = {
|
||||
static const struct wl_input_method_listener input_method_listener = {
|
||||
input_method_activate,
|
||||
input_method_deactivate
|
||||
};
|
||||
@@ -736,14 +736,14 @@ global_handler(struct display *display, uint32_t name,
|
||||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
|
||||
if (!strcmp(interface, "input_panel")) {
|
||||
if (!strcmp(interface, "wl_input_panel")) {
|
||||
keyboard->input_panel =
|
||||
display_bind(display, name, &input_panel_interface, 1);
|
||||
} else if (!strcmp(interface, "input_method")) {
|
||||
display_bind(display, name, &wl_input_panel_interface, 1);
|
||||
} else if (!strcmp(interface, "wl_input_method")) {
|
||||
keyboard->input_method =
|
||||
display_bind(display, name,
|
||||
&input_method_interface, 1);
|
||||
input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard);
|
||||
&wl_input_method_interface, 1);
|
||||
wl_input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,8 +752,8 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
|
||||
{
|
||||
struct keyboard *keyboard;
|
||||
const struct layout *layout;
|
||||
struct input_panel_surface *ips;
|
||||
|
||||
struct wl_input_panel_surface *ips;
|
||||
|
||||
layout = get_current_layout(virtual_keyboard);
|
||||
|
||||
keyboard = malloc(sizeof *keyboard);
|
||||
@@ -777,12 +777,12 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
|
||||
layout->rows * key_height);
|
||||
|
||||
|
||||
ips = input_panel_get_input_panel_surface(virtual_keyboard->input_panel,
|
||||
window_get_wl_surface(keyboard->window));
|
||||
ips = wl_input_panel_get_input_panel_surface(virtual_keyboard->input_panel,
|
||||
window_get_wl_surface(keyboard->window));
|
||||
|
||||
input_panel_surface_set_toplevel(ips,
|
||||
output_get_wl_output(output),
|
||||
INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
|
||||
wl_input_panel_surface_set_toplevel(ips,
|
||||
output_get_wl_output(output),
|
||||
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+62
-62
@@ -51,8 +51,8 @@ typedef void (*keyboard_input_key_handler_t)(struct simple_im *keyboard,
|
||||
enum wl_keyboard_key_state state);
|
||||
|
||||
struct simple_im {
|
||||
struct input_method *input_method;
|
||||
struct input_method_context *context;
|
||||
struct wl_input_method *input_method;
|
||||
struct wl_input_method_context *context;
|
||||
struct wl_display *display;
|
||||
struct wl_registry *registry;
|
||||
struct wl_keyboard *keyboard;
|
||||
@@ -102,7 +102,7 @@ static const uint32_t ignore_keys_on_compose[] = {
|
||||
|
||||
static void
|
||||
handle_surrounding_text(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
const char *text,
|
||||
uint32_t cursor,
|
||||
uint32_t anchor)
|
||||
@@ -112,7 +112,7 @@ handle_surrounding_text(void *data,
|
||||
|
||||
static void
|
||||
handle_reset(void *data,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
|
||||
@@ -123,7 +123,7 @@ handle_reset(void *data,
|
||||
|
||||
static void
|
||||
handle_content_type(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t hint,
|
||||
uint32_t purpose)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ handle_content_type(void *data,
|
||||
|
||||
static void
|
||||
handle_invoke_action(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t button,
|
||||
uint32_t index)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ handle_invoke_action(void *data,
|
||||
|
||||
static void
|
||||
handle_commit_state(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
uint32_t serial)
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
@@ -149,12 +149,12 @@ handle_commit_state(void *data,
|
||||
|
||||
static void
|
||||
handle_preferred_language(void *data,
|
||||
struct input_method_context *context,
|
||||
struct wl_input_method_context *context,
|
||||
const char *language)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct input_method_context_listener input_method_context_listener = {
|
||||
static const struct wl_input_method_context_listener input_method_context_listener = {
|
||||
handle_surrounding_text,
|
||||
handle_reset,
|
||||
handle_content_type,
|
||||
@@ -253,7 +253,7 @@ input_method_keyboard_modifiers(void *data,
|
||||
uint32_t group)
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
struct input_method_context *context = keyboard->context;
|
||||
struct wl_input_method_context *context = keyboard->context;
|
||||
xkb_mod_mask_t mask;
|
||||
|
||||
xkb_state_update_mask(keyboard->state, mods_depressed,
|
||||
@@ -270,9 +270,9 @@ input_method_keyboard_modifiers(void *data,
|
||||
if (mask & keyboard->shift_mask)
|
||||
keyboard->modifiers |= MOD_SHIFT_MASK;
|
||||
|
||||
input_method_context_modifiers(context, serial,
|
||||
mods_depressed, mods_depressed,
|
||||
mods_latched, group);
|
||||
wl_input_method_context_modifiers(context, serial,
|
||||
mods_depressed, mods_depressed,
|
||||
mods_latched, group);
|
||||
}
|
||||
|
||||
static const struct wl_keyboard_listener input_method_keyboard_listener = {
|
||||
@@ -285,23 +285,23 @@ static const struct wl_keyboard_listener input_method_keyboard_listener = {
|
||||
|
||||
static void
|
||||
input_method_activate(void *data,
|
||||
struct input_method *input_method,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method *input_method,
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
|
||||
if (keyboard->context)
|
||||
input_method_context_destroy(keyboard->context);
|
||||
wl_input_method_context_destroy(keyboard->context);
|
||||
|
||||
keyboard->compose_state = state_normal;
|
||||
|
||||
keyboard->serial = 0;
|
||||
|
||||
keyboard->context = context;
|
||||
input_method_context_add_listener(context,
|
||||
&input_method_context_listener,
|
||||
keyboard);
|
||||
keyboard->keyboard = input_method_context_grab_keyboard(context);
|
||||
wl_input_method_context_add_listener(context,
|
||||
&input_method_context_listener,
|
||||
keyboard);
|
||||
keyboard->keyboard = wl_input_method_context_grab_keyboard(context);
|
||||
wl_keyboard_add_listener(keyboard->keyboard,
|
||||
&input_method_keyboard_listener,
|
||||
keyboard);
|
||||
@@ -309,19 +309,19 @@ input_method_activate(void *data,
|
||||
|
||||
static void
|
||||
input_method_deactivate(void *data,
|
||||
struct input_method *input_method,
|
||||
struct input_method_context *context)
|
||||
struct wl_input_method *input_method,
|
||||
struct wl_input_method_context *context)
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
|
||||
if (!keyboard->context)
|
||||
return;
|
||||
|
||||
input_method_context_destroy(keyboard->context);
|
||||
wl_input_method_context_destroy(keyboard->context);
|
||||
keyboard->context = NULL;
|
||||
}
|
||||
|
||||
static const struct input_method_listener input_method_listener = {
|
||||
static const struct wl_input_method_listener input_method_listener = {
|
||||
input_method_activate,
|
||||
input_method_deactivate
|
||||
};
|
||||
@@ -332,12 +332,12 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
||||
{
|
||||
struct simple_im *keyboard = data;
|
||||
|
||||
if (!strcmp(interface, "input_method")) {
|
||||
if (!strcmp(interface, "wl_input_method")) {
|
||||
keyboard->input_method =
|
||||
wl_registry_bind(registry, name,
|
||||
&input_method_interface, 1);
|
||||
input_method_add_listener(keyboard->input_method,
|
||||
&input_method_listener, keyboard);
|
||||
&wl_input_method_interface, 1);
|
||||
wl_input_method_add_listener(keyboard->input_method,
|
||||
&input_method_listener, keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ simple_im_key_handler(struct simple_im *keyboard,
|
||||
uint32_t serial, uint32_t time, uint32_t key, uint32_t sym,
|
||||
enum wl_keyboard_key_state state)
|
||||
{
|
||||
struct input_method_context *context = keyboard->context;
|
||||
struct wl_input_method_context *context = keyboard->context;
|
||||
char text[64];
|
||||
|
||||
if (sym == XKB_KEY_Multi_key &&
|
||||
@@ -396,7 +396,7 @@ simple_im_key_handler(struct simple_im *keyboard,
|
||||
|
||||
for (i = 0; i < sizeof(ignore_keys_on_compose) / sizeof(ignore_keys_on_compose[0]); i++) {
|
||||
if (sym == ignore_keys_on_compose[i]) {
|
||||
input_method_context_key(context, keyboard->serial, time, key, state);
|
||||
wl_input_method_context_key(context, keyboard->serial, time, key, state);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -411,16 +411,16 @@ simple_im_key_handler(struct simple_im *keyboard,
|
||||
|
||||
if (cs) {
|
||||
if (cs->keys[i + 1] == 0) {
|
||||
input_method_context_preedit_cursor(keyboard->context,
|
||||
0);
|
||||
input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
"", "");
|
||||
input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
cs->text);
|
||||
wl_input_method_context_preedit_cursor(keyboard->context,
|
||||
0);
|
||||
wl_input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
"", "");
|
||||
wl_input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
wl_input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
cs->text);
|
||||
keyboard->compose_state = state_normal;
|
||||
} else {
|
||||
uint32_t j = 0, idx = 0;
|
||||
@@ -429,12 +429,12 @@ simple_im_key_handler(struct simple_im *keyboard,
|
||||
idx += xkb_keysym_to_utf8(cs->keys[j], text + idx, sizeof(text) - idx);
|
||||
}
|
||||
|
||||
input_method_context_preedit_cursor(keyboard->context,
|
||||
strlen(text));
|
||||
input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text,
|
||||
text);
|
||||
wl_input_method_context_preedit_cursor(keyboard->context,
|
||||
strlen(text));
|
||||
wl_input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text,
|
||||
text);
|
||||
}
|
||||
} else {
|
||||
uint32_t j = 0, idx = 0;
|
||||
@@ -442,34 +442,34 @@ simple_im_key_handler(struct simple_im *keyboard,
|
||||
for (; j <= i; j++) {
|
||||
idx += xkb_keysym_to_utf8(keyboard->compose_seq.keys[j], text + idx, sizeof(text) - idx);
|
||||
}
|
||||
input_method_context_preedit_cursor(keyboard->context,
|
||||
0);
|
||||
input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
"", "");
|
||||
input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text);
|
||||
wl_input_method_context_preedit_cursor(keyboard->context,
|
||||
0);
|
||||
wl_input_method_context_preedit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
"", "");
|
||||
wl_input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
wl_input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text);
|
||||
keyboard->compose_state = state_normal;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) {
|
||||
input_method_context_key(context, serial, time, key, state);
|
||||
wl_input_method_context_key(context, serial, time, key, state);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
|
||||
return;
|
||||
|
||||
input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text);
|
||||
wl_input_method_context_cursor_position(keyboard->context,
|
||||
0, 0);
|
||||
wl_input_method_context_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
text);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user