From 86314caa5b6bd382c7532491d8fc02cafcdf7970 Mon Sep 17 00:00:00 2001 From: nyorain Date: Fri, 18 Aug 2017 18:51:09 +0200 Subject: Implement wlr_data_{source,device,device_manager} --- examples/compositor/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples') diff --git a/examples/compositor/main.c b/examples/compositor/main.c index 1fe81046..02b75dc6 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include "shared.h" @@ -31,6 +32,7 @@ struct sample_state { struct wlr_wl_shell *wl_shell; struct wlr_seat *wl_seat; struct wlr_xdg_shell_v6 *xdg_shell; + struct wlr_data_device_manager *data_device_manager; struct wl_resource *focus; struct wl_listener keyboard_bound; int keymap_fd; @@ -130,6 +132,9 @@ static void handle_keyboard_bound(struct wl_listener *listener, void *data) { wl_keyboard_send_keymap(handle->keyboard, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, state->keymap_fd, state->keymap_size); + + if (wl_resource_get_version(handle->keyboard) >= 2) + wl_keyboard_send_repeat_info(handle->keyboard, 660, 25); } int main() { @@ -150,6 +155,7 @@ int main() { wl_compositor_init(compositor.display, &state.compositor, state.renderer); state.wl_shell = wlr_wl_shell_create(compositor.display); state.xdg_shell = wlr_xdg_shell_v6_create(compositor.display); + state.data_device_manager = wlr_data_device_manager_create(compositor.display); state.wl_seat = wlr_seat_create(compositor.display, "seat0"); state.keyboard_bound.notify = handle_keyboard_bound; -- cgit v1.2.3