From e38c83197090b5e40ebe00b4ede0afb9e5644104 Mon Sep 17 00:00:00 2001 From: Neale Swinnerton Date: Mon, 26 Jan 2026 20:20:12 +0000 Subject: [PATCH] feat(Gui): set client name to FreeCAD when connecting to spacenav This enables per-application configuration in spacenavd for FreeCAD. --- src/Gui/3Dconnexion/GuiNativeEventLinux.cpp | 1 + src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp | 1 + src/Gui/Quarter/SpaceNavigatorDevice.cpp | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp index 8a93dfd233..c8e1eef835 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp @@ -55,6 +55,7 @@ void Gui::GuiNativeEvent::initSpaceball(QMainWindow* window) ); } else { + spnav_client_name("FreeCAD"); Base::Console().log("Connected to spacenav daemon\n"); QSocketNotifier* SpacenavNotifier = new QSocketNotifier(spnav_fd(), QSocketNotifier::Read, this); diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp index 83b218c571..f1840300e8 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp @@ -75,6 +75,7 @@ void Gui::GuiNativeEvent::initSpaceball(QMainWindow* window) .log("Couldn't connect to spacenav daemon on X11. Please ignore if you don't have a spacemouse.\n"); } else { + spnav_client_name("FreeCAD"); Base::Console().log("Connected to spacenav daemon on X11\n"); mainApp->setSpaceballPresent(true); mainApp->installNativeEventFilter(new Gui::RawInputEventFilter(&xcbEventFilter)); diff --git a/src/Gui/Quarter/SpaceNavigatorDevice.cpp b/src/Gui/Quarter/SpaceNavigatorDevice.cpp index 2a636fc1bc..9a9e50dcfa 100644 --- a/src/Gui/Quarter/SpaceNavigatorDevice.cpp +++ b/src/Gui/Quarter/SpaceNavigatorDevice.cpp @@ -94,6 +94,9 @@ SpaceNavigatorDevice::SpaceNavigatorDevice(QuarterWidget* quarter) : if (!PRIVATE(this)->hasdevice) { fprintf(stderr, "Quarter:: Could not hook up to Spacenav device.\n"); } + else { + spnav_client_name("FreeCAD"); + } #endif // HAVE_SPACENAV_LIB }