From ba43d98ac276c06052827059727ba42052ba5458 Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Mon, 11 Mar 2013 18:31:09 +0100 Subject: wayland: use the cursor_autohide_delay option In the previous implemention the backend always assumed 1 second instead of honoring the cursor_autohide_delay option --- video/out/wayland_common.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 5aee33e048..449214ea4f 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -411,15 +411,18 @@ static void pointer_handle_motion(void *data, display->cursor.pointer = pointer; - struct itimerspec its; - if (wl->window->type == TYPE_FULLSCREEN) { show_cursor(display); - its.it_interval.tv_sec = 1; - its.it_interval.tv_nsec = 0; - its.it_value.tv_sec = 1; - its.it_value.tv_nsec = 0; + struct itimerspec its; + int ms = wl->vo->opts->cursor_autohide_delay; + int sec = ms / 1000; + ms %= 1000; + + its.it_interval.tv_sec = 0; + its.it_interval.tv_nsec = 100 * 1000 * 1000; + its.it_value.tv_sec = sec; + its.it_value.tv_nsec = ms * 1000 * 1000; timerfd_settime(display->cursor.timer_fd, 0, &its, NULL); } } -- cgit v1.2.3