1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-12 09:59:44 +00:00

w32_common: capture mouse input

Mouse buttons can get stuck down if the button is pressed inside the
video window and released outside. Avoid this by capturing mouse input
when a button is pressed.
This commit is contained in:
James Ross-Gowan 2014-02-21 01:21:17 +11:00 committed by wm4
parent b05803c2e1
commit 6402b9dc38

View File

@ -465,6 +465,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
return 0;
}
}
if (mouse_button & MP_KEY_STATE_DOWN)
SetCapture(w32->window);
else
ReleaseCapture();
}
return DefWindowProcW(hWnd, message, wParam, lParam);