diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 449e27b689..67333da9b7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2836,20 +2836,17 @@ void Application::cleanupBeforeQuit() { } Application::~Application() { - qCInfo(interfaceapp) << "HRS FIXME Quit 1"; // remove avatars from physics engine auto avatarManager = DependencyManager::get(); avatarManager->clearOtherAvatars(); auto myCharacterController = getMyAvatar()->getCharacterController(); myCharacterController->clearDetailedMotionStates(); - qCInfo(interfaceapp) << "HRS FIXME Quit 2"; PhysicsEngine::Transaction transaction; avatarManager->buildPhysicsTransaction(transaction); _physicsEngine->processTransaction(transaction); avatarManager->handleProcessedPhysicsTransaction(transaction); avatarManager->deleteAllAvatars(); - qCInfo(interfaceapp) << "HRS FIXME Quit 3"; _physicsEngine->setCharacterController(nullptr); @@ -2860,12 +2857,9 @@ Application::~Application() { // shutdown graphics engine _graphicsEngine.shutdown(); - qCInfo(interfaceapp) << "HRS FIXME Quit 4"; _gameWorkload.shutdown(); - qCInfo(interfaceapp) << "HRS FIXME Quit 5"; DependencyManager::destroy(); - qCInfo(interfaceapp) << "HRS FIXME Quit 6"; #ifdef Q_OS_MAC DependencyManager::destroy(); #endif diff --git a/interface/src/MacHelper.cpp b/interface/src/MacHelper.cpp index f6b76649cd..b3513afdc9 100755 --- a/interface/src/MacHelper.cpp +++ b/interface/src/MacHelper.cpp @@ -11,32 +11,34 @@ #include "InterfaceLogging.h" #include "MacHelper.h" +#include #ifdef Q_OS_MAC -#include #include - -io_connect_t root_port; -IONotificationPortRef notifyPortRef; -io_object_t notifierObject; -void* refCon; +#include -void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) { - qCInfo(interfaceapp) << "HRS FIXME sleepHandler."; +// These type definitions come from IOKit, which includes a definition of Duration that conflicts with ours. +// So... we include these definitions here rather than in the .h, as the .h is included in Application.cpp which +// uses Duration. +static io_connect_t root_port; +static IONotificationPortRef notifyPortRef; +static io_object_t notifierObject; +static void* refCon; + +static void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) { if (messageType == kIOMessageSystemHasPoweredOn) { - qCInfo(interfaceapp) << "HRS FIXME Waking up from sleep or hybernation."; + qCInfo(interfaceapp) << "Waking up from sleep or hybernation."; + QMetaObject::invokeMethod(DependencyManager::get().data(), "noteAwakening", Qt::QueuedConnection); } } #endif MacHelper::MacHelper() { - qCInfo(interfaceapp) << "HRS FIXME Start MacHelper."; #ifdef Q_OS_MAC root_port = IORegisterForSystemPower(refCon, ¬ifyPortRef, sleepHandler, ¬ifierObject); if (root_port == 0) { qCWarning(interfaceapp) << "IORegisterForSystemPower failed"; - } else { - qCDebug(interfaceapp) << "HRS FIXME IORegisterForSystemPower OK"; + return; } CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notifyPortRef), @@ -45,7 +47,6 @@ MacHelper::MacHelper() { } MacHelper::~MacHelper() { - qCInfo(interfaceapp) << "HRS FIXME End MacHelper."; #ifdef Q_OS_MAC CFRunLoopRemoveSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notifyPortRef),