summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2014-09-19 17:38:24 +0200
committerAlexander Preisinger <alexander.preisinger@gmail.com>2014-09-19 17:38:24 +0200
commit29467736cf3e8c7ec9a3eb30397a3b7d07e432db (patch)
treefebc2582468b552d7d67ab5773c75428604ba1f8 /video/out/wayland_common.c
parentbe516022b60e85daa1e7faa28a6d9ca656968bb3 (diff)
downloadmpv-29467736cf3e8c7ec9a3eb30397a3b7d07e432db.tar.bz2
mpv-29467736cf3e8c7ec9a3eb30397a3b7d07e432db.tar.xz
wayland: use reported rete and delay
If native-keyrepeat is true then we set the rate and delay reported by the compositor.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index f5f662ec3c..4eb7eb2d45 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -320,12 +320,28 @@ static void keyboard_handle_modifiers(void *data,
0, 0, group);
}
+static void keyboard_handle_repeat_info(void *data,
+ struct wl_keyboard *wl_keyboard,
+ int32_t rate,
+ int32_t delay)
+{
+ struct vo_wayland_state *wl = data;
+ if (wl->vo->opts->native_keyrepeat) {
+ if (rate < 0 || delay < 0) {
+ MP_WARN(wl, "Invalid rate or delay values sent by compositor\n");
+ return;
+ }
+ mp_input_set_repeat_info(wl->vo->input_ctx, rate, delay);
+ }
+}
+
static const struct wl_keyboard_listener keyboard_listener = {
keyboard_handle_keymap,
keyboard_handle_enter,
keyboard_handle_leave,
keyboard_handle_key,
- keyboard_handle_modifiers
+ keyboard_handle_modifiers,
+ keyboard_handle_repeat_info
};
/* POINTER LISTENER */
@@ -450,8 +466,17 @@ static void seat_handle_capabilities(void *data,
}
}
+static void seat_handle_name(void *data,
+ struct wl_seat *seat,
+ const char *name)
+{
+ struct vo_wayland_state *wl = data;
+ MP_VERBOSE(wl, "Seat \"%s\" connected\n", name);
+}
+
static const struct wl_seat_listener seat_listener = {
seat_handle_capabilities,
+ seat_handle_name,
};
static void data_offer_handle_offer(void *data,
@@ -593,7 +618,7 @@ static void registry_handle_global (void *data,
else if (strcmp(interface, "wl_seat") == 0) {
- wl->input.seat = wl_registry_bind(reg, id, &wl_seat_interface, 1);
+ wl->input.seat = wl_registry_bind(reg, id, &wl_seat_interface, 4);
wl_seat_add_listener(wl->input.seat, &seat_listener, wl);
wl->input.datadev = wl_data_device_manager_get_data_device(