Fix spnav not enabled by default on linux after #19226 and #19407

This commit is contained in:
Adrian Insaurralde
2025-02-16 17:44:56 -03:00
parent 145af5cddc
commit a862071e3e
2 changed files with 8 additions and 0 deletions

View File

@@ -59,11 +59,15 @@ Gui::GUIApplicationNativeEventAware::~GUIApplicationNativeEventAware() = default
void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window)
{
#if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
# if defined(USE_3DCONNEXION_NAVLIB)
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/View");
if (nativeEvent && hViewGrp->GetBool("LegacySpaceMouseDevices", false)) {
nativeEvent->initSpaceball(window);
}
# else
nativeEvent->initSpaceball(window);
# endif
#else
Q_UNUSED(window);
#endif

View File

@@ -567,11 +567,15 @@ void View3DInventorViewer::init()
//filter a few qt events
viewerEventFilter = new ViewerEventFilter;
installEventFilter(viewerEventFilter);
#if defined(USE_3DCONNEXION_NAVLIB)
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/View");
if (hViewGrp->GetBool("LegacySpaceMouseDevices", false)) {
getEventFilter()->registerInputDevice(new SpaceNavigatorDevice);
}
#else
getEventFilter()->registerInputDevice(new SpaceNavigatorDevice);
#endif
getEventFilter()->registerInputDevice(new GesturesDevice(this));
try{