0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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
This commit is contained in:
Diogo Franco (Kovensky) 2013-07-20 18:28:43 -03:00 committed by wm4
parent b9944e2dc1
commit 03fd2fe61c

View File

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