summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-05-20 21:25:05 -0400
committerKristian Høgsberg <krh@bitplanet.net>2013-05-20 21:25:05 -0400
commita496133d5a2c80b087a7de29a4b75df312e3fd30 (patch)
tree24e6c5e6dace68691f50c3a50958ebdc9b75d7c4
parentfe097f95a340ed19299b39131cdbf4c66b0c7ce1 (diff)
compositor: Make sending keyboard map a weston_seat vfunc
This allows a backend or module to override the implementation, which will be useful for remote display where we can't send fds.
-rw-r--r--src/compositor.h2
-rw-r--r--src/input.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/compositor.h b/src/compositor.h
index 318fc0d3..c32ced1b 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -437,6 +437,8 @@ struct weston_seat {
uint32_t num_tp;
void (*led_update)(struct weston_seat *ws, enum weston_led leds);
+ void (*send_keymap)(struct weston_seat *seat,
+ struct wl_resource *resource);
struct weston_xkb_info xkb_info;
struct {
diff --git a/src/input.c b/src/input.c
index 129593f2..b6215340 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1199,9 +1199,12 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
wl_list_insert(&seat->keyboard->resource_list, &cr->link);
cr->destroy = unbind_resource;
- wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- seat->xkb_info.keymap_fd,
- seat->xkb_info.keymap_size);
+ if (seat->send_keymap)
+ seat->send_keymap(seat, cr);
+ else
+ wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
+ seat->xkb_info.keymap_fd,
+ seat->xkb_info.keymap_size);
if (seat->keyboard->focus &&
seat->keyboard->focus->resource.client == client) {