1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-01 04:31:39 +00:00

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
This commit is contained in:
Alexander Preisinger 2013-03-11 18:31:09 +01:00
parent f2debeca66
commit ba43d98ac2

View File

@ -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);
}
}