Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by wmayer »

Here is the link to the Blender code that handles spnav support: https://github.com/UPBGE/blender/blob/m ... erUnix.cpp
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by PrzemoF »

I just tested the latest nightly after spnav was included in fedora.spec file and the 3DConnexion mouse works fine. Buttons in the FreeCAD menu are not visible unless they are pressed on the mouse, but I guess it's OK. :D I'm not sure what was the reason of the problem.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by ian.rees »

I'm late to the party, but not having success with this yet in Ubuntu 18.04...

I've installed libspnav-dev and spacenavd, and FreeCAD's cmake says:

-- Found Spnav: /usr/lib/libspnav.so

However, it appears that HAVE_SPACENAV_LIB never gets defined, so it would seem that most of the spacenavigator-related code isn't being built in anymore. There are also some Qt5 changes around the X11 interface - PrzemoF, are you using Qt 4 or 5?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by PrzemoF »

Qt4. Full build log are on copr server if you're interested.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by ian.rees »

Cheers! I think I need to do some reading on the Qt5 X11 interface, but it's getting a bit late tonight to start on that...
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by ian.rees »

I've finally had some time to look at this - found a couple things in the Linux (I'm using Ubuntu 18.04) and Qt5 case:

1) The define for SPNAV_FOUND is being set, but the code is mostly just checking for HAVE_SPACENAV_LIB, which isn't set. Am I understanding right, that HAVE_SPACENAV_LIB was only ever for Linux? Or, is there another platform where we use it?

2) After working around 1, the next problem is that the Qt native event handling has switched from providing XEvent with Qt4 to providing xcb_generic_event_t events in Qt5. Transcribing a few fields between the provided XCB event, and a temporary XEvent, seems to work well enough. However, there's still something broken - after a few seconds of spinning the world around with SpaceNavigator, it stops responding to SpaceNavigator events, and then crashes when exiting FreeCAD. It's totally possibly that the hang is due to some prototype or debug code that I've left in - will try to clean it up tomorrow and see what's going on.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by wmayer »

1) The define for SPNAV_FOUND is being set, but the code is mostly just checking for HAVE_SPACENAV_LIB, which isn't set. Am I understanding right, that HAVE_SPACENAV_LIB was only ever for Linux? Or, is there another platform where we use it?
Ignore all the code where HAVE_SPACENAV_LIB is used. That's Coin's implementation we never used because we supported SpaceNavigators before moving to Quarter. Instead we have put the event handling into the class GUIApplicationNativeEventAware.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by ian.rees »

Ahh, that makes more sense... I'm hoping to have a PR ready to submit for this tonight.

Edit: Still a couple small things to do, but I think this works - https://github.com/ianrrees/FreeCAD_tin ... enavigator
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to connect to SpaceNavigator with FreeCAD 0.17 on Fedora 28

Post by wmayer »

@ian.rees I guess you have available a space mouse.
In the German forum there was a request and also in this thread it has been discussed to use the alternative API functions of the spacenav library which doesn't rely on the X11 server but uses sockets instead. Any idea if this is feasible or how much work this will be to implement?
Post Reply