diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ded414ceab..fff65a6955 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -366,6 +366,12 @@ public: return true; } } + + if (message->message == WM_CLOSE) { + // tell our registered application to quit + QMetaObject::invokeMethod(qApp, "quit"); + return true; // Don't zombify the application by OS-exitting. Let the application quit in the normal quit-signal way. + } } return false; } @@ -718,12 +724,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : connect(addressManager.data(), &AddressManager::hostChanged, this, &Application::updateWindowTitle); connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress); - // setup a shutdown event listener to handle SIGTERM or WM_CLOSE for us -#ifdef _WIN32 - installNativeEventFilter(&ShutdownEventListener::getInstance()); -#else - ShutdownEventListener::getInstance(); -#endif // Save avatar location immediately after a teleport. connect(getMyAvatar(), &MyAvatar::positionGoneTo, diff --git a/libraries/shared/src/ShutdownEventListener.cpp b/libraries/shared/src/ShutdownEventListener.cpp index fa2209f9b7..e640126b7b 100644 --- a/libraries/shared/src/ShutdownEventListener.cpp +++ b/libraries/shared/src/ShutdownEventListener.cpp @@ -47,7 +47,6 @@ bool ShutdownEventListener::nativeEventFilter(const QByteArray &eventType, void* if (message->message == WM_CLOSE) { // tell our registered application to quit QMetaObject::invokeMethod(qApp, "quit"); - return true; // Don't zombify the application by OS-exitting. Let the application quit in the normal quit-signal way. } } #endif