Merge pull request #19660 from adrianinsaval/fix-spnav-regression

Fix spnav not enabled by default on linux after #19226 and #19407
This commit is contained in:
Chris Hennes
2025-02-21 14:20:55 -06:00
committed by GitHub
3 changed files with 11 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

@@ -62,6 +62,9 @@ DlgSettingsNavigation::DlgSettingsNavigation(QWidget* parent)
retranslate();
#if !defined(_USE_3DCONNEXION_SDK) && !defined(SPNAV_FOUND)
ui->legacySpaceMouseDevices->setDisabled(true);
#elif !defined(USE_3DCONNEXION_NAVLIB)
ui->spaceMouseDevice->setHidden(true);
ui->legacySpaceMouseDevices->setHidden(true);
#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{