This is a mixture of bug/feature request. My application dynamically opens and closes multiple Display connections and windows to the same X server, which clashes with the current API. For me, the ideal API would be:
int spnav_x11_open(Display *dpy, Window win);
int spnav_x11_close(Display *dpy, Window win);
... where the open call does a spnav_open on the first call, and only a spnav_x11_window on subsequent calls. Likewise, spnav_x11_close, does a spnav_close on the last close.
With the current API I can implement multiple window support on a single Display by using spnav_x11_window, refcounting and calling spnav_close, but I'm loosing spacemouse events if I close all windows and the Display connection.
I can give more background if needed, but imo the proposed API is more consistent even for single-window, single-Display use.
This is the issue on our end: https://github.com/Eyescale/Equalizer/issues/150