From: <dc...@us...> - 2013-02-27 06:11:58
|
Revision: 1516 http://freeglut.svn.sourceforge.net/freeglut/?rev=1516&view=rev Author: dcnieho Date: 2013-02-27 06:11:51 +0000 (Wed, 27 Feb 2013) Log Message: ----------- 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 Modified Paths: -------------- trunk/freeglut/freeglut/src/mswin/fg_main_mswin.c Modified: trunk/freeglut/freeglut/src/mswin/fg_main_mswin.c =================================================================== --- trunk/freeglut/freeglut/src/mswin/fg_main_mswin.c 2013-02-27 05:58:56 UTC (rev 1515) +++ trunk/freeglut/freeglut/src/mswin/fg_main_mswin.c 2013-02-27 06:11:51 UTC (rev 1516) @@ -523,20 +523,8 @@ lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); - if (child_window) - { - /* 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 */ + SetActiveWindow( window->Window.Handle ); + INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) ); UpdateWindow ( hWnd ); break; @@ -751,8 +739,11 @@ { int wheel_number = LOWORD( wParam ); short ticks = ( short )HIWORD( wParam ); - fgState.MouseWheelTicks += ticks; + if (child_window) + window = child_window; + + fgState.MouseWheelTicks += ticks; if ( abs ( fgState.MouseWheelTicks ) >= WHEEL_DELTA ) { int direction = ( fgState.MouseWheelTicks > 0 ) ? 1 : -1; @@ -806,16 +797,12 @@ case WM_SYSKEYDOWN: case WM_KEYDOWN: - if (child_window) - window = child_window; - lRet = fghWindowProcKeyPress(window,uMsg,GL_TRUE,wParam,lParam); + lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_TRUE,wParam,lParam); break; case WM_SYSKEYUP: case WM_KEYUP: - if (child_window) - window = child_window; - lRet = fghWindowProcKeyPress(window,uMsg,GL_FALSE,wParam,lParam); + lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_FALSE,wParam,lParam); break; case WM_SYSCHAR: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |