X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_spaceball.c;h=a2e70edb2a122fb5fd68ea6d9e61300939ab51f4;hb=ac26c64653954569627ad5413240cbd8453cd814;hp=a36008e08038c6a4ab9794d3ff31fc8ac3333149;hpb=8507764d48cceb8461f9d0194915fa0b7fb58447;p=freeglut diff --git a/src/freeglut_spaceball.c b/src/freeglut_spaceball.c index a36008e..a2e70ed 100644 --- a/src/freeglut_spaceball.c +++ b/src/freeglut_spaceball.c @@ -143,11 +143,13 @@ int fgIsSpaceballXEvent(const XEvent *xev) { spnav_event sev; + if(spnav_win != fgStructure.CurrentWindow) { + /* this will also initialize spaceball if needed (first call) */ + fgSpaceballSetWindow(fgStructure.CurrentWindow); + } + if(!sball_initialized) { - fgInitialiseSpaceball(); - if(!sball_initialized) { - return 0; - } + return 0; } return spnav_x11_event(xev, &sev); @@ -215,7 +217,10 @@ OF SUCH DAMAGE. #include #include #include + +#if HAVE_ERRNO_H #include +#endif #include #include