Commit 7d8ef2e1 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Properly handle negative coordinates for mouse events.

parent ff068c08
...@@ -227,8 +227,8 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, ...@@ -227,8 +227,8 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
LONG state; LONG state;
HANDLE oldHbitmap; HANDLE oldHbitmap;
pt.x = LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = HIWORD(lParam); pt.y = (short)HIWORD(lParam);
switch (uMsg) switch (uMsg)
{ {
......
...@@ -1703,8 +1703,8 @@ static void COMBO_LButtonDown( LPHEADCOMBO lphc, LPARAM lParam ) ...@@ -1703,8 +1703,8 @@ static void COMBO_LButtonDown( LPHEADCOMBO lphc, LPARAM lParam )
BOOL bButton; BOOL bButton;
HWND hWnd = lphc->self; HWND hWnd = lphc->self;
pt.x = LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = HIWORD(lParam); pt.y = (short)HIWORD(lParam);
bButton = PtInRect(&lphc->buttonRect, pt); bButton = PtInRect(&lphc->buttonRect, pt);
if( (CB_GETTYPE(lphc) == CBS_DROPDOWNLIST) || if( (CB_GETTYPE(lphc) == CBS_DROPDOWNLIST) ||
...@@ -1780,8 +1780,8 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam ) ...@@ -1780,8 +1780,8 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam )
POINT pt; POINT pt;
RECT lbRect; RECT lbRect;
pt.x = LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = HIWORD(lParam); pt.y = (short)HIWORD(lParam);
if( lphc->wState & CBF_BUTTONDOWN ) if( lphc->wState & CBF_BUTTONDOWN )
{ {
......
...@@ -2732,8 +2732,8 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, ...@@ -2732,8 +2732,8 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
POINT pt; POINT pt;
RECT rect; RECT rect;
pt.x = LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = HIWORD(lParam); pt.y = (short)HIWORD(lParam);
rect.left = 0; rect.left = 0;
rect.top = 0; rect.top = 0;
rect.right = descr->width; rect.right = descr->width;
......
...@@ -1771,7 +1771,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, ...@@ -1771,7 +1771,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
INT x, INT y, INT xanchor, INT yanchor ) INT x, INT y, INT xanchor, INT yanchor )
{ {
POPUPMENU *menu; POPUPMENU *menu;
UINT width, height; INT width, height;
POINT pt; POINT pt;
HMONITOR monitor; HMONITOR monitor;
MONITORINFO info; MONITORINFO info;
......
...@@ -2785,8 +2785,8 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f ...@@ -2785,8 +2785,8 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f
} }
thread_info->GetMessageTimeVal = msg.time; thread_info->GetMessageTimeVal = msg.time;
msg.pt.x = LOWORD( thread_info->GetMessagePosVal ); msg.pt.x = (short)LOWORD( thread_info->GetMessagePosVal );
msg.pt.y = HIWORD( thread_info->GetMessagePosVal ); msg.pt.y = (short)HIWORD( thread_info->GetMessagePosVal );
HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)&msg, TRUE ); HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)&msg, TRUE );
......
...@@ -3023,8 +3023,8 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt ) ...@@ -3023,8 +3023,8 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
if( msg.message == WM_MOUSEMOVE ) if( msg.message == WM_MOUSEMOVE )
{ {
POINT tmp; POINT tmp;
tmp.x = LOWORD(msg.lParam); tmp.x = (short)LOWORD(msg.lParam);
tmp.y = HIWORD(msg.lParam); tmp.y = (short)HIWORD(msg.lParam);
if( !PtInRect( &rect, tmp )) if( !PtInRect( &rect, tmp ))
{ {
ReleaseCapture(); ReleaseCapture();
......
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