Uploading spaceball/set-window patch per e-mail from John Tsiombikas dated 1:34 PM...
[freeglut] / src / freeglut_spaceball.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