diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp index 2c594f1f42..c136b5509d 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp @@ -8,7 +8,8 @@ Implementation by Torsten Sadowski 2018 #include #include #include -#include + +#include #include @@ -35,9 +36,8 @@ void Gui::GuiNativeEvent::initSpaceball(QMainWindow *window) Base::Console().Log("Couldn't connect to spacenav daemon\n"); } else { Base::Console().Log("Connected to spacenav daemon\n"); - QTimer* SpacenavPollTimer = new QTimer(this); - connect(SpacenavPollTimer, &QTimer::timeout, this, &GuiNativeEvent::pollSpacenav); - SpacenavPollTimer->start(20); + QSocketNotifier* SpacenavNotifier = new QSocketNotifier(spnav_fd(), QSocketNotifier::Read, this); + connect(SpacenavNotifier, &QSocketNotifier::activated, this, &GuiNativeEvent::pollSpacenav); mainApp->setSpaceballPresent(true); } }