commit 86b4fa6
Michael Forney
·
2014-10-01 07:10:30 +0000 UTC
parent bf972a9
seat: Support version 4
3 files changed,
+12,
-4
M
Makefile
+1,
-1
1@@ -23,7 +23,7 @@ SUBDIRS := launch libswc protocol cursor example
2 CLEAN_FILES := $(TARGETS)
3
4 libinput_CONSTRAINTS := >= 0.4
5-wayland-server_CONSTRAINTS := >= 1.5.0
6+wayland-server_CONSTRAINTS := >= 1.6.0
7
8 include config.mk
9
+8,
-0
1@@ -35,6 +35,8 @@
2 #include <stdio.h>
3 #include <string.h>
4
5+static const int repeat_delay = 500, repeat_rate = 40;
6+
7 static void enter(struct input_focus_handler * handler,
8 struct wl_resource * resource, struct compositor_view * view)
9 {
10@@ -220,6 +222,12 @@ struct wl_resource * keyboard_bind(struct keyboard * keyboard,
11 keyboard->xkb.keymap.fd,
12 keyboard->xkb.keymap.size - 1);
13
14+ if (version >= 4)
15+ {
16+ wl_keyboard_send_repeat_info(client_resource,
17+ repeat_rate, repeat_delay);
18+ }
19+
20 return client_resource;
21 }
22
+3,
-3
1@@ -206,8 +206,8 @@ static void bind_seat(struct wl_client * client, void * data, uint32_t version,
2 {
3 struct wl_resource * resource;
4
5- if (version >= 2)
6- version = 2;
7+ if (version >= 4)
8+ version = 4;
9
10 resource = wl_resource_create(client, &wl_seat_interface, version, id);
11 wl_resource_set_implementation(resource, &seat_implementation, NULL,
12@@ -454,7 +454,7 @@ bool swc_seat_initialize(const char * seat_name)
13 goto error0;
14 }
15
16- seat.global = wl_global_create(swc.display, &wl_seat_interface, 3,
17+ seat.global = wl_global_create(swc.display, &wl_seat_interface, 4,
18 NULL, &bind_seat);
19
20 if (!seat.global)