Uploading spaceball/set-window patch per e-mail from John Tsiombikas dated 1:34 PM...
authorJohn F. Fay <johnffay@nettally.com>
Thu, 3 Dec 2009 03:21:12 +0000 (03:21 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Thu, 3 Dec 2009 03:21:12 +0000 (03:21 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@856 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_spaceball.c
src/freeglut_window.c

index 154e52d..a2e70ed 100644 (file)
@@ -143,11 +143,13 @@ int fgIsSpaceballXEvent(const XEvent *xev)
 {\r
     spnav_event sev;\r
 \r
+    if(spnav_win != fgStructure.CurrentWindow) {\r
+        /* this will also initialize spaceball if needed (first call) */\r
+        fgSpaceballSetWindow(fgStructure.CurrentWindow);\r
+    }\r
+\r
     if(!sball_initialized) {\r
-        fgInitialiseSpaceball();\r
-        if(!sball_initialized) {\r
-            return 0;\r
-        }\r
+        return 0;\r
     }\r
 \r
     return spnav_x11_event(xev, &sev);\r
index e19eaff..f0e0754 100644 (file)
@@ -600,9 +600,6 @@ void fgSetWindow ( SFG_Window *window )
             window->Window.Handle,
             window->Window.Context
         );
-
-        /* also register this window to receive spaceball events */
-        fgSpaceballSetWindow(window);
     }
 #elif TARGET_HOST_MS_WINDOWS
     if( fgStructure.CurrentWindow )