From d05b679932b8c938dfe0bacdb31a16dac072ef21 Mon Sep 17 00:00:00 2001 From: Eun Date: Thu, 11 Sep 2014 07:51:14 +0200 Subject: [PATCH] Fixed Issue #5 --- DisableMonitorAppDelegate.m | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/DisableMonitorAppDelegate.m b/DisableMonitorAppDelegate.m index 7345eff..3ceb9d9 100644 --- a/DisableMonitorAppDelegate.m +++ b/DisableMonitorAppDelegate.m @@ -334,14 +334,7 @@ -(void)ToggleMonitor:(DisplayData*) displayData enabled:(Boolean) enabled return; } - //CGConfigureDisplayFadeEffect (config, 0, 0, 0, 0, 0); - - err = CGCompleteDisplayConfiguration(config, kCGConfigurePermanently); - if (err != 0) - { - ShowError(@"Error in CGCompleteDisplayConfiguration: %d", err); - } - + CGConfigureDisplayFadeEffect (config, 0, 0, 0, 0, 0); io_registry_entry_t entry = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/IOResources/IODisplayWrangler"); if (entry) @@ -351,10 +344,12 @@ -(void)ToggleMonitor:(DisplayData*) displayData enabled:(Boolean) enabled IORegistryEntrySetCFProperty(entry, CFSTR("IORequestIdle"), kCFBooleanFalse); IOObjectRelease(entry); } - - - + err = CGCompleteDisplayConfiguration(config, kCGConfigurePermanently); + if (err != 0) + { + ShowError(@"Error in CGCompleteDisplayConfiguration: %d", err); + } } @catch (NSException *exception) {