Quick hack fixing issue 1483 (cursor issue). this file really needs some cleanup, too :p

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4386 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-10-08 22:10:19 +00:00
parent 8af6280af2
commit 09a9f44e83
1 changed files with 9 additions and 3 deletions

View File

@ -220,6 +220,8 @@ void FreeLookInput( UINT iMsg, WPARAM wParam )
lastMouse[0] = point.x; lastMouse[0] = point.x;
lastMouse[1] = point.y; lastMouse[1] = point.y;
} }
// This looks like it might leak cursors, but it really doesn't.
// See http://msdn.microsoft.com/en-us/library/ms648391(VS.85).aspx
break; break;
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
@ -267,6 +269,8 @@ void OnKeyDown(WPARAM wParam)
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Should really take a look at the mouse stuff in here - some of it is weird.
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{ {
switch (iMsg) switch (iMsg)
@ -304,7 +308,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
OnKeyDown(wParam); OnKeyDown(wParam);
break; break;
/* Post thes mouse events to the main window, it's nessesary becase in difference to the /* Post these mouse events to the main window, it's nessesary becase in difference to the
keyboard inputs these events only appear here, not in the parent window or any other WndProc()*/ keyboard inputs these events only appear here, not in the parent window or any other WndProc()*/
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
case WM_LBUTTONUP: case WM_LBUTTONUP:
@ -319,10 +323,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
same as the one before. */ same as the one before. */
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
/* Check rendering mode; child or parent. Then post the mouse moves to the main window /* Check rendering mode; child or parent. Then post the mouse moves to the main window
it's nessesary for both the chil dwindow and separate rendering window because it's nessesary for both the child window and separate rendering window because
moves over the rendering window do not reach the main program then. */ moves over the rendering window do not reach the main program then. */
if (GetParentWnd() == NULL) // Separate rendering window if (GetParentWnd() == NULL) { // Separate rendering window
PostMessage(m_hParent, iMsg, wParam, -1); PostMessage(m_hParent, iMsg, wParam, -1);
SetCursor(hCursor);
}
else else
PostMessage(GetParentWnd(), iMsg, wParam, lParam); PostMessage(GetParentWnd(), iMsg, wParam, lParam);
break; break;