aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-08-18 18:51:09 +0200
committernyorain <nyorain@gmail.com>2017-08-18 18:56:21 +0200
commit86314caa5b6bd382c7532491d8fc02cafcdf7970 (patch)
tree5385a4f0506099c983f107dc1a2acb092c737e5e /examples
parente5fd858394831388ad0677960387ed4a5331df47 (diff)
Implement wlr_data_{source,device,device_manager}
Diffstat (limited to 'examples')
-rw-r--r--examples/compositor/main.c6
1 files changed, 6 insertions, 0 deletions
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 <wlr/types/wlr_wl_shell.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_data_device_manager.h>
#include <xkbcommon/xkbcommon.h>
#include <wlr/util/log.h>
#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;