WM_SETFOCUS should not change focus to child instead, then all input goes to child even if it should go to parent. Mousewheel needed to check if actually in child, other mouse action (move, press) are automatically passed to child

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1516 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2013-02-27 06:11:51 +00:00
parent 6f9152c92e
commit 8363fa9507

View File

@ -523,20 +523,8 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
if (child_window) SetActiveWindow( window->Window.Handle );
{ INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) );
/* If we're dealing with a child window, make sure it has input focus instead, set it here. */
SetFocus(child_window->Window.Handle);
SetActiveWindow( child_window->Window.Handle );
INVOKE_WCB( *child_window, Entry, ( GLUT_ENTERED ) );
UpdateWindow ( child_window->Window.Handle );
}
else
{
SetActiveWindow( window->Window.Handle );
INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) );
}
/* Always request update on main window to be safe */
UpdateWindow ( hWnd ); UpdateWindow ( hWnd );
break; break;
@ -751,8 +739,11 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
{ {
int wheel_number = LOWORD( wParam ); int wheel_number = LOWORD( wParam );
short ticks = ( short )HIWORD( wParam ); short ticks = ( short )HIWORD( wParam );
fgState.MouseWheelTicks += ticks;
if (child_window)
window = child_window;
fgState.MouseWheelTicks += ticks;
if ( abs ( fgState.MouseWheelTicks ) >= WHEEL_DELTA ) if ( abs ( fgState.MouseWheelTicks ) >= WHEEL_DELTA )
{ {
int direction = ( fgState.MouseWheelTicks > 0 ) ? 1 : -1; int direction = ( fgState.MouseWheelTicks > 0 ) ? 1 : -1;
@ -806,16 +797,12 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
case WM_KEYDOWN: case WM_KEYDOWN:
if (child_window) lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_TRUE,wParam,lParam);
window = child_window;
lRet = fghWindowProcKeyPress(window,uMsg,GL_TRUE,wParam,lParam);
break; break;
case WM_SYSKEYUP: case WM_SYSKEYUP:
case WM_KEYUP: case WM_KEYUP:
if (child_window) lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_FALSE,wParam,lParam);
window = child_window;
lRet = fghWindowProcKeyPress(window,uMsg,GL_FALSE,wParam,lParam);
break; break;
case WM_SYSCHAR: case WM_SYSCHAR: