Windows: Make sure the DirectInput even buffer is properly flushed before switching to grabbed state.

This commit is contained in:
Elias Naur 2006-06-18 09:08:55 +00:00
parent d7542e3a71
commit 72c0fc81b8
1 changed files with 3 additions and 1 deletions

View File

@ -393,6 +393,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse
HRESULT di_res;
if(grab) {
if (!mouse_grabbed) {
// flush DX event buffer
readDXBuffer(env);
mouse_grabbed = true;
IDirectInputDevice_Unacquire(mDIDevice);
if (!acquireMouse(DISCL_EXCLUSIVE | DISCL_FOREGROUND))