summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>2013-07-20 18:28:43 -0300
committerwm4 <wm4@nowhere>2013-07-21 01:14:18 +0200
commit03fd2fe61c71ae8ebfca3db246694ae293ce7c30 (patch)
treea6e7be0237a02f56b455c2336642d492c90f9b88 /core
parentb9944e2dc12e557d0c92052f9abac9ea298320db (diff)
downloadmpv-03fd2fe61c71ae8ebfca3db246694ae293ce7c30.tar.bz2
mpv-03fd2fe61c71ae8ebfca3db246694ae293ce7c30.tar.xz
input: Ignore spurious mouse moves
Windows generates WM_MOUSEMOVE messages internally whenever the window manager wants to know where the mouse is[1] and broadcasts that to everyone; w32_common doesn't check whether the position is different and just (indirectly) calls this. Do the check on input.c since it's possible some other VO or frontend also do the same thing. [1]: http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
Diffstat (limited to 'core')
-rw-r--r--core/input/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/input/input.c b/core/input/input.c
index 7ae76b9e04..66d78b48c6 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -1536,6 +1536,10 @@ static void trigger_mouse_leave(struct input_ctx *ictx, char *new_section)
void mp_input_set_mouse_pos(struct input_ctx *ictx, int x, int y)
{
+ // we're already there
+ if (ictx->mouse_vo_x == x && ictx->mouse_vo_y == y)
+ return;
+
ictx->mouse_event_counter++;
ictx->mouse_vo_x = x;
ictx->mouse_vo_y = y;