input: add weston_keyboard_send_keymap helper function

We've always had "send_keymap" internally, but some places failed to use
it.  Since we also use this in the text backend, export it.

Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Derek Foreman 8 years ago
parent dc1418ae8e
commit f8f7fd69df
  1. 4
      compositor/text-backend.c
  2. 4
      libweston/compositor.h
  3. 14
      libweston/input.c

@ -680,9 +680,7 @@ input_method_context_grab_keyboard(struct wl_client *client,
context->keyboard = cr; context->keyboard = cr;
wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, weston_keyboard_send_keymap(keyboard, cr);
keyboard->xkb_info->keymap_fd,
keyboard->xkb_info->keymap_size);
if (keyboard->grab != &keyboard->default_grab) { if (keyboard->grab != &keyboard->default_grab) {
weston_keyboard_end_grab(keyboard); weston_keyboard_end_grab(keyboard);

@ -2186,6 +2186,10 @@ void
weston_seat_set_keyboard_focus(struct weston_seat *seat, weston_seat_set_keyboard_focus(struct weston_seat *seat,
struct weston_surface *surface); struct weston_surface *surface);
void
weston_keyboard_send_keymap(struct weston_keyboard *kbd,
struct wl_resource *resource);
int int
weston_compositor_load_xwayland(struct weston_compositor *compositor); weston_compositor_load_xwayland(struct weston_compositor *compositor);

@ -2080,9 +2080,11 @@ update_modifier_state(struct weston_seat *seat, uint32_t serial, uint32_t key,
notify_modifiers(seat, serial); notify_modifiers(seat, serial);
} }
static void WL_EXPORT void
send_keymap(struct wl_resource *resource, struct weston_xkb_info *xkb_info) weston_keyboard_send_keymap(struct weston_keyboard *kbd, struct wl_resource *resource)
{ {
struct weston_xkb_info *xkb_info = kbd->xkb_info;
wl_keyboard_send_keymap(resource, wl_keyboard_send_keymap(resource,
WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
xkb_info->keymap_fd, xkb_info->keymap_fd,
@ -2146,9 +2148,9 @@ update_keymap(struct weston_seat *seat)
keyboard->xkb_state.state = state; keyboard->xkb_state.state = state;
wl_resource_for_each(resource, &keyboard->resource_list) wl_resource_for_each(resource, &keyboard->resource_list)
send_keymap(resource, xkb_info); weston_keyboard_send_keymap(keyboard, resource);
wl_resource_for_each(resource, &keyboard->focus_resource_list) wl_resource_for_each(resource, &keyboard->focus_resource_list)
send_keymap(resource, xkb_info); weston_keyboard_send_keymap(keyboard, resource);
notify_modifiers(seat, wl_display_next_serial(seat->compositor->wl_display)); notify_modifiers(seat, wl_display_next_serial(seat->compositor->wl_display));
@ -2890,9 +2892,7 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
seat->compositor->kb_repeat_delay); seat->compositor->kb_repeat_delay);
} }
wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, weston_keyboard_send_keymap(keyboard, cr);
keyboard->xkb_info->keymap_fd,
keyboard->xkb_info->keymap_size);
if (should_send_modifiers_to_client(seat, client)) { if (should_send_modifiers_to_client(seat, client)) {
send_modifiers_to_resource(keyboard, send_modifiers_to_resource(keyboard,

Loading…
Cancel
Save