X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_spaceball.c;h=cab97e1e1c7f898c022a5ebbb115f26f2cf4c5c5;hb=d00e8ab2bef9c76647e01c67b30628a2ca59bfd4;hp=a36008e08038c6a4ab9794d3ff31fc8ac3333149;hpb=8507764d48cceb8461f9d0194915fa0b7fb58447;p=freeglut diff --git a/src/freeglut_spaceball.c b/src/freeglut_spaceball.c index a36008e..cab97e1 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 + +#ifdef HAVE_ERRNO_H #include +#endif #include #include