diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-11 18:31:09 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-11 18:31:09 +0100 |
commit | ba43d98ac276c06052827059727ba42052ba5458 (patch) | |
tree | 83e8a2ad994f069fa3ac8b81281beb2f36ecefa9 /video | |
parent | f2debeca660f02eee551645c7997915142463cac (diff) | |
download | mpv-ba43d98ac276c06052827059727ba42052ba5458.tar.bz2 mpv-ba43d98ac276c06052827059727ba42052ba5458.tar.xz |
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
Diffstat (limited to 'video')
-rw-r--r-- | video/out/wayland_common.c | 15 |
1 files changed, 9 insertions, 6 deletions
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); } } |