From 98eea65605e98d3e6febcd1780b68595670d7183 Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Mon, 11 Mar 2019 00:37:24 -0400 Subject: x11: fix cursor hiding initial state Regression from 8e3308d687c3acdd0d572015b06efd5b492d93ee. Broken cases were: * --no-cursor-autohide acted like --cursor-autohide=always. * --cursor-autohide-fs-only always hid the cursor if starting non-fullscreen; entering fullscreen at least once fixed it. --- video/out/x11_common.c | 1 + video/out/x11_common.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/video/out/x11_common.c b/video/out/x11_common.c index f01d7e2610..467fa827ac 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1425,6 +1425,7 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, XSetWMProtocols(x11->display, x11->window, protos, 1); x11->mouse_cursor_set = false; + x11->mouse_cursor_visible = true; vo_update_cursor(vo); if (x11->xim) { diff --git a/video/out/x11_common.h b/video/out/x11_common.h index 608534052c..ca01f61b0c 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -88,8 +88,9 @@ struct vo_x11_state { bool pseudo_mapped; // not necessarily mapped, but known window size int fs; // whether we assume the window is in fullscreen mode - bool mouse_cursor_visible; - bool mouse_cursor_set; + bool mouse_cursor_visible; // whether we want the cursor to be visible (only + // takes effect when the window is focused) + bool mouse_cursor_set; // whether the cursor is *currently* *hidden* bool has_focus; long orig_layer; -- cgit v1.2.3