diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 6d7fb6592..986151b7c 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -445,6 +445,10 @@ void MainWindow::closeEvent(QCloseEvent *event) { } qt_nvr_save(); config_save(); +#ifdef __unix__ + extern void xinput2_exit(); + if (QApplication::platformName() == "xcb") xinput2_exit(); +#endif event->accept(); } diff --git a/src/qt/xinput2_mouse.cpp b/src/qt/xinput2_mouse.cpp index b8af6f309..0c31f6ca0 100644 --- a/src/qt/xinput2_mouse.cpp +++ b/src/qt/xinput2_mouse.cpp @@ -152,9 +152,12 @@ void xinput2_proc() void xinput2_exit() { - exitthread = true; - procThread->wait(5000); - procThread->terminate(); + if (!exitthread) + { + exitthread = true; + procThread->wait(5000); + procThread->terminate(); + } } void xinput2_init()