Commit abade021 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

Mouse events fix.

parent 8081e5a1
...@@ -108,6 +108,7 @@ struct SysMouseAImpl ...@@ -108,6 +108,7 @@ struct SysMouseAImpl
LONG prevX, prevY; LONG prevX, prevY;
LPMOUSE_EVENT_PROC prev_handler; LPMOUSE_EVENT_PROC prev_handler;
HWND win; HWND win;
DWORD dwCoopLevel;
DWORD win_centerX, win_centerY; DWORD win_centerX, win_centerY;
LPDIDEVICEOBJECTDATA data_queue; LPDIDEVICEOBJECTDATA data_queue;
int queue_pos, queue_len; int queue_pos, queue_len;
...@@ -259,6 +260,7 @@ static HRESULT WINAPI SysMouseAImpl_SetCooperativeLevel( ...@@ -259,6 +260,7 @@ static HRESULT WINAPI SysMouseAImpl_SetCooperativeLevel(
/* Store the window which asks for the mouse */ /* Store the window which asks for the mouse */
This->win = hwnd; This->win = hwnd;
This->dwCoopLevel = dwflags;
return 0; return 0;
} }
...@@ -350,8 +352,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, ...@@ -350,8 +352,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
(posX == This->win_centerX) && (posX == This->win_centerX)) { (posX == This->win_centerX) && (posX == This->win_centerX)) {
/* Warp has been done... */ /* Warp has been done... */
This->need_warp = WARP_DONE; This->need_warp = WARP_DONE;
LeaveCriticalSection(&(This->crit)); goto end;
return;
} }
/* Relative mouse input with absolute mouse event : the real fun starts here... */ /* Relative mouse input with absolute mouse event : the real fun starts here... */
...@@ -426,8 +427,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, ...@@ -426,8 +427,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
} }
} else { } else {
ERR("Mouse event not supported...\n"); ERR("Mouse event not supported...\n");
LeaveCriticalSection(&(This->crit)); goto end;
return ;
} }
if (TRACE_ON(dinput)) { if (TRACE_ON(dinput)) {
...@@ -479,6 +479,12 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, ...@@ -479,6 +479,12 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
This->m_state.lX, This->m_state.lY, This->m_state.lX, This->m_state.lY,
This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]); This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]);
end:
if (This->dwCoopLevel & DISCL_NONEXCLUSIVE)
{ /* pass the events down to previous handlers (e.g. win32 input) */
if (This->prev_handler)
This->prev_handler(dwFlags, dx, dy, cButtons, dwExtraInfo);
}
LeaveCriticalSection(&(This->crit)); LeaveCriticalSection(&(This->crit));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment