commit 86b4fa6e7b8bf56491ad5349919064467ac94ec7
parent bf972a9f912d94ca4426cb956650654236d2bddb
Author: Michael Forney <mforney@mforney.org>
Date: Wed, 1 Oct 2014 00:10:30 -0700
seat: Support version 4
Diffstat:
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -23,7 +23,7 @@ SUBDIRS := launch libswc protocol cursor example
CLEAN_FILES := $(TARGETS)
libinput_CONSTRAINTS := >= 0.4
-wayland-server_CONSTRAINTS := >= 1.5.0
+wayland-server_CONSTRAINTS := >= 1.6.0
include config.mk
diff --git a/libswc/keyboard.c b/libswc/keyboard.c
@@ -35,6 +35,8 @@
#include <stdio.h>
#include <string.h>
+static const int repeat_delay = 500, repeat_rate = 40;
+
static void enter(struct input_focus_handler * handler,
struct wl_resource * resource, struct compositor_view * view)
{
@@ -220,6 +222,12 @@ struct wl_resource * keyboard_bind(struct keyboard * keyboard,
keyboard->xkb.keymap.fd,
keyboard->xkb.keymap.size - 1);
+ if (version >= 4)
+ {
+ wl_keyboard_send_repeat_info(client_resource,
+ repeat_rate, repeat_delay);
+ }
+
return client_resource;
}
diff --git a/libswc/seat.c b/libswc/seat.c
@@ -206,8 +206,8 @@ static void bind_seat(struct wl_client * client, void * data, uint32_t version,
{
struct wl_resource * resource;
- if (version >= 2)
- version = 2;
+ if (version >= 4)
+ version = 4;
resource = wl_resource_create(client, &wl_seat_interface, version, id);
wl_resource_set_implementation(resource, &seat_implementation, NULL,
@@ -454,7 +454,7 @@ bool swc_seat_initialize(const char * seat_name)
goto error0;
}
- seat.global = wl_global_create(swc.display, &wl_seat_interface, 3,
+ seat.global = wl_global_create(swc.display, &wl_seat_interface, 4,
NULL, &bind_seat);
if (!seat.global)