mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-19 06:50:16 +00:00
Port for macOS (#311)
* merged moonlight-mac with moonlight-ios * reverted to the original project.pbxproj * cleaned up the code, fixed lots of unnecessary code duplications * multicontroller support (not tested) * new class that can be used for further modularization of the MainFrameViewController
This commit is contained in:
committed by
Cameron Gutman
parent
1c86c4485d
commit
6cc165b589
30
Moonlight macOS/Utility/keepAlive.m
Normal file
30
Moonlight macOS/Utility/keepAlive.m
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// keepAlive.m
|
||||
// LittleHelper
|
||||
//
|
||||
// Created by Felix Kratz on 31.10.17.
|
||||
// Copyright © 2017 Felix Kratz. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <IOKit/pwr_mgt/IOPMLib.h>
|
||||
#import "keepAlive.h"
|
||||
|
||||
|
||||
@implementation keepAlive
|
||||
|
||||
CFStringRef reasonForActivity= CFSTR("Moonlight keeps the system awake");
|
||||
IOPMAssertionID assertionID;
|
||||
|
||||
+(void) keepSystemAlive
|
||||
{
|
||||
|
||||
IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
|
||||
kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
|
||||
}
|
||||
|
||||
+(void) allowSleep
|
||||
{
|
||||
IOPMAssertionRelease(assertionID);
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user