src/freeglut_main.c:816 and :1571, set the current window (John F. Fay)
[freeglut] / src / freeglut_main.c
index 858116a..50dd5e4 100644 (file)
@@ -814,6 +814,11 @@ void FGAPIENTRY glutMainLoopEvent( void )
          */
         if( fgStructure.Window->Callbacks.Mouse == NULL )
           break;
+        /*
+         * Set the current window
+         */
+        fgSetWindow ( window );
+
 
         /*
          * Remember the current modifiers state
@@ -1571,6 +1576,11 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
             ( ( (GetKeyState( VK_LMENU    ) < 0 ) || ( GetKeyState( VK_RMENU    ) < 0 )) ? GLUT_ACTIVE_ALT   : 0 );
 
         /*
+         * Set the current window
+         */
+        fgSetWindow ( window );
+
+        /*
          * Finally execute the mouse callback
          */
         fgStructure.Window->Callbacks.Mouse(