mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 22:39:18 +02:00
PR feedback
This commit is contained in:
parent
dfd78a2662
commit
e1bf3f2540
4 changed files with 11 additions and 5 deletions
|
@ -956,7 +956,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
|
||||||
DependencyManager::set<AvatarPackager>();
|
DependencyManager::set<AvatarPackager>();
|
||||||
PlatformHelper::setup();
|
PlatformHelper::setup();
|
||||||
|
|
||||||
QObject::connect(DependencyManager::get<PlatformHelper>().get(), &PlatformHelper::systemWillWake, [] {
|
QObject::connect(PlatformHelper::instance(), &PlatformHelper::systemWillWake, [] {
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<NodeList>().data(), "noteAwakening", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(DependencyManager::get<NodeList>().data(), "noteAwakening", Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1167,13 +1167,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
// Pause the deadlock watchdog when we sleep, or it might
|
// Pause the deadlock watchdog when we sleep, or it might
|
||||||
// trigger a false positive when we wake back up
|
// trigger a false positive when we wake back up
|
||||||
auto platformHelper = DependencyManager::get<PlatformHelper>();
|
auto platformHelper = PlatformHelper::instance();
|
||||||
|
|
||||||
connect(platformHelper.get(), &PlatformHelper::systemWillSleep, [] {
|
connect(platformHelper, &PlatformHelper::systemWillSleep, [] {
|
||||||
DeadlockWatchdogThread::pause();
|
DeadlockWatchdogThread::pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(platformHelper.get(), &PlatformHelper::systemWillWake, [] {
|
connect(platformHelper, &PlatformHelper::systemWillWake, [] {
|
||||||
DeadlockWatchdogThread::resume();
|
DeadlockWatchdogThread::resume();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,3 +25,7 @@ void PlatformHelper::shutdown() {
|
||||||
DependencyManager::destroy<PlatformHelper>();
|
DependencyManager::destroy<PlatformHelper>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlatformHelper* PlatformHelper::instance() {
|
||||||
|
return DependencyManager::get<PlatformHelper>().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ public:
|
||||||
static void setup();
|
static void setup();
|
||||||
// Run the per-platform code to cleanly shutdown a platform-dependent PlatformHelper dependency object
|
// Run the per-platform code to cleanly shutdown a platform-dependent PlatformHelper dependency object
|
||||||
static void shutdown();
|
static void shutdown();
|
||||||
|
// Fetch the platform specific instance of the helper
|
||||||
|
static PlatformHelper* instance();
|
||||||
|
|
||||||
std::atomic<bool> _awake{ true };
|
std::atomic<bool> _awake{ true };
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "../PlatformHelper.h"
|
#include "../PlatformHelper.h"
|
||||||
|
|
||||||
#if !defined(Q_OS_ANDROID) && defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
#include <IOKit/IOMessage.h>
|
#include <IOKit/IOMessage.h>
|
||||||
#include <IOKit/pwr_mgt/IOPMLib.h>
|
#include <IOKit/pwr_mgt/IOPMLib.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue