本文介绍了如何从OSX 10.7.4的显示睡眠中唤醒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在最新版本的OSX Lion中,如何从显示睡眠中唤醒计算机?这是对网络活动的响应.
In the most recent version of OSX Lion, how do you wake up the machine from display sleep? This is in response to network activity.
在10.7.3中,可以通过以下调用来实现:
In 10.7.3 this was possible with the following call:
IOPMAssertionID id = 0;
IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
kIOPMAssertionLevelOn, reason, &id)
但是,这在10.7.4中不起作用.可以做什么呢?
However, this does not work in 10.7.4. What can be done instead?
推荐答案
我尚未测试性能影响或与空闲计时器本身的交互,但是:
I have not yet tested the performance implications nor the interaction with the idle timer itself, but:
io_registry_entry_t regEntry = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/IOResources/IODisplayWrangler");
if (regEntry != MACH_PORT_NULL) {
IORegistryEntrySetCFProperty(regEntry, CFSTR("IORequestIdle"), kCFBooleanFalse);
IOObjectRelease(regEntry);
}
在10.7.4中工作,以将屏幕从空闲状态唤醒.
works in 10.7.4 to wake the screen from idle.
这篇关于如何从OSX 10.7.4的显示睡眠中唤醒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!