From d0c288c8743ed272fd006442bc1ce9217e878372 Mon Sep 17 00:00:00 2001 From: Eun Date: Mon, 2 Mar 2015 10:31:29 +0100 Subject: [PATCH] Trying to reset the wallpapers --- DisableMonitor-Info.plist | 4 ++-- DisableMonitorAppDelegate.m | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/DisableMonitor-Info.plist b/DisableMonitor-Info.plist index a7bc248..16889a5 100644 --- a/DisableMonitor-Info.plist +++ b/DisableMonitor-Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.9 + 1.91 CFBundleSignature ???? CFBundleVersion - 1.9 + 1.91 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} LSUIElement diff --git a/DisableMonitorAppDelegate.m b/DisableMonitorAppDelegate.m index 2ef621d..26dd173 100644 --- a/DisableMonitorAppDelegate.m +++ b/DisableMonitorAppDelegate.m @@ -327,6 +327,13 @@ +(void)toggleMonitor:(CGDirectDisplayID)displayID enabled:(Boolean) enabled ShowError(@"Error in CGCompleteDisplayConfiguration: %d", err); } + // reset the wallpapers (Issue #10) + NSArray *screens = [NSScreen screens]; + for (NSScreen *screen in screens) { + NSURL *url = [[NSWorkspace sharedWorkspace] desktopImageURLForScreen:screen]; + NSDictionary *options = [[NSWorkspace sharedWorkspace] desktopImageOptionsForScreen:screen]; + [[NSWorkspace sharedWorkspace] setDesktopImageURL:url forScreen:screen options:options error:nil]; + } } @catch (NSException *exception) { NSLog(@"Exception:" );