mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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>();
|
||||
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);
|
||||
});
|
||||
|
||||
|
@ -1167,13 +1167,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
|
||||
// Pause the deadlock watchdog when we sleep, or it might
|
||||
// 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();
|
||||
});
|
||||
|
||||
connect(platformHelper.get(), &PlatformHelper::systemWillWake, [] {
|
||||
connect(platformHelper, &PlatformHelper::systemWillWake, [] {
|
||||
DeadlockWatchdogThread::resume();
|
||||
});
|
||||
|
||||
|
|
|
@ -25,3 +25,7 @@ void PlatformHelper::shutdown() {
|
|||
DependencyManager::destroy<PlatformHelper>();
|
||||
}
|
||||
|
||||
PlatformHelper* PlatformHelper::instance() {
|
||||
return DependencyManager::get<PlatformHelper>().get();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
static void setup();
|
||||
// Run the per-platform code to cleanly shutdown a platform-dependent PlatformHelper dependency object
|
||||
static void shutdown();
|
||||
// Fetch the platform specific instance of the helper
|
||||
static PlatformHelper* instance();
|
||||
|
||||
std::atomic<bool> _awake{ true };
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "../PlatformHelper.h"
|
||||
|
||||
#if !defined(Q_OS_ANDROID) && defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <IOKit/IOMessage.h>
|
||||
#include <IOKit/pwr_mgt/IOPMLib.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue