summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.h
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2013-07-14 22:57:39 +1000
committerwm4 <wm4@nowhere>2013-07-21 18:05:22 +0200
commitd784759bc05bcc62401940148d9aaa7cace6975c (patch)
treea961423a49b49a1070cff70ddab5c2c470b1e6e9 /video/out/w32_common.h
parent5f265d5930588a4a1b065e18a84b25a15b4b1d66 (diff)
downloadmpv-d784759bc05bcc62401940148d9aaa7cace6975c.tar.bz2
mpv-d784759bc05bcc62401940148d9aaa7cace6975c.tar.xz
w32_common: show the cursor in the window border
When the cursor was in the window border, it could be hidden but it wouldn't appear again, since mpv doesn't process mouse input there. The code used ShowCursor, which is a horrid stateful API designed for mouseless Win16 systems that incremented or decremented a global counter to keep track of how many applications needed to display a special cursor (like a busy cursor.) Replace that with a simple flag, handle WM_SETCURSOR and use SetCursor(NULL) to hide the mouse cursor, but only when the mouse is in the client area. DefWindowProc will set the correct cursor on the border as long as it isn't hidden with ShowCursor. PowerPoint also uses SetCursor(NULL) to hide the cursor when showing a presentation, so it's probably safe. See http://blogs.msdn.com/b/oldnewthing/archive/2009/12/17/9937972.aspx
Diffstat (limited to 'video/out/w32_common.h')
-rw-r--r--video/out/w32_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/w32_common.h b/video/out/w32_common.h
index 3db34a8472..8465f028d6 100644
--- a/video/out/w32_common.h
+++ b/video/out/w32_common.h
@@ -45,6 +45,7 @@ struct vo_w32_state {
uint32_t o_dheight;
bool disable_screensaver;
+ bool cursor_visible;
int event_flags;
int mon_cnt;
int mon_id;