summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-22 19:37:28 +0100
committerAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-23 12:58:34 +0100
commit1fc58386d10be728bf608c4e6b6a1e0d44b943b9 (patch)
tree39498b91eaec6d07fce015e5b02877eaa4b82a9f /video
parentd22a3fdb09f8fed214fca9e829936ae5a3116f5b (diff)
downloadmpv-1fc58386d10be728bf608c4e6b6a1e0d44b943b9.tar.bz2
mpv-1fc58386d10be728bf608c4e6b6a1e0d44b943b9.tar.xz
wayland: fully support cursor autohide options
I missed the special cases in the previous commits.
Diffstat (limited to 'video')
-rw-r--r--video/out/wayland_common.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 449214ea4f..b1f08fce4d 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -61,8 +61,8 @@
static int lookupkey(int key);
-static void hide_cursor(struct vo_wayland_display * display);
-static void show_cursor(struct vo_wayland_display * display);
+static void hide_cursor(struct vo_wayland_state * wl);
+static void show_cursor(struct vo_wayland_state * wl);
/*** wayland interface ***/
@@ -386,10 +386,10 @@ static void pointer_handle_enter(void *data,
* because after moving the shell surface no release event is sent */
mplayer_put_key(wl->vo->key_fifo, MP_MOUSE_BTN0);
- if (wl->window->type == TYPE_FULLSCREEN)
- hide_cursor(display);
+ if (wl->window->type == TYPE_FULLSCREEN || wl->vo->opts->cursor_autohide_delay == -2)
+ hide_cursor(wl);
else if (display->cursor.default_cursor) {
- show_cursor(display);
+ show_cursor(wl);
}
}
@@ -412,7 +412,7 @@ static void pointer_handle_motion(void *data,
display->cursor.pointer = pointer;
if (wl->window->type == TYPE_FULLSCREEN) {
- show_cursor(display);
+ show_cursor(wl);
struct itimerspec its;
int ms = wl->vo->opts->cursor_autohide_delay;
@@ -631,18 +631,20 @@ static int lookupkey(int key)
return mpkey;
}
-static void hide_cursor (struct vo_wayland_display *display)
+static void hide_cursor (struct vo_wayland_state *wl)
{
- if (!display->cursor.pointer)
+ struct vo_wayland_display *display = wl->display;
+ if (!display->cursor.pointer || wl->vo->opts->cursor_autohide_delay == -1)
return;
wl_pointer_set_cursor(display->cursor.pointer, display->cursor.serial,
NULL, 0, 0);
}
-static void show_cursor (struct vo_wayland_display *display)
+static void show_cursor (struct vo_wayland_state *wl)
{
- if (!display->cursor.pointer)
+ struct vo_wayland_display *display = wl->display;
+ if (!display->cursor.pointer || wl->vo->opts->cursor_autohide_delay == -2)
return;
struct wl_buffer *buffer;
@@ -707,10 +709,8 @@ static void cursor_timer_func(struct vo_wayland_task *task,
uint32_t events,
struct vo_wayland_state *wl)
{
- struct vo_wayland_display *display = wl->display;
-
if (wl->window->type == TYPE_FULLSCREEN)
- hide_cursor(display);
+ hide_cursor(wl);
}
static void keyboard_timer_func(struct vo_wayland_task *task,
@@ -939,7 +939,7 @@ void vo_wayland_fullscreen (struct vo *vo)
wl->window->type = TYPE_FULLSCREEN;
vo->opts->fs = true;
- hide_cursor(wl->display);
+ hide_cursor(wl);
}
else {
@@ -949,7 +949,7 @@ void vo_wayland_fullscreen (struct vo *vo)
wl->window->type = TYPE_TOPLEVEL;
vo->opts->fs = false;
- show_cursor(wl->display);
+ show_cursor(wl);
}
}