{
/* Check if the current window that the mouse is over is a child window
* of the window the message was sent to. Some events only sent to main window,
* and when handling some messages, we need to make sure that we process
* callbacks on the child window instead. This mirrors how GLUT does things.
{
/* Check if the current window that the mouse is over is a child window
* of the window the message was sent to. Some events only sent to main window,
* and when handling some messages, we need to make sure that we process
* callbacks on the child window instead. This mirrors how GLUT does things.
- DWORD mouse_pos_Dword = GetMessagePos();
- mouse_pos.x = GET_X_LPARAM(mouse_pos_Dword);
- mouse_pos.y = GET_Y_LPARAM(mouse_pos_Dword);
+ DWORD mouse_pos_dw = GetMessagePos();
+ POINT mouse_pos = {GET_X_LPARAM(mouse_pos_dw), GET_Y_LPARAM(mouse_pos_dw)};
ScreenToClient( window->Window.Handle, &mouse_pos );
hwnd = ChildWindowFromPoint(window->Window.Handle, mouse_pos);
if (hwnd && hwnd!=window->Window.Handle) /* can be NULL if mouse outside parent by the time we get here, or can be same as parent if we didn't find a child */
{
ScreenToClient( window->Window.Handle, &mouse_pos );
hwnd = ChildWindowFromPoint(window->Window.Handle, mouse_pos);
if (hwnd && hwnd!=window->Window.Handle) /* can be NULL if mouse outside parent by the time we get here, or can be same as parent if we didn't find a child */
{
- SFG_Window *child_window = NULL;
- fghWindowUnderCursor(window, &child_window);
- lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_TRUE,wParam,lParam);
+ window = fghWindowUnderCursor(window);
+ lRet = fghWindowProcKeyPress(window,uMsg,GL_TRUE,wParam,lParam);
- SFG_Window *child_window = NULL;
- fghWindowUnderCursor(window, &child_window);
- lRet = fghWindowProcKeyPress(child_window?child_window:window,uMsg,GL_FALSE,wParam,lParam);
+ window = fghWindowUnderCursor(window);
+ lRet = fghWindowProcKeyPress(window,uMsg,GL_FALSE,wParam,lParam);