Skip to content

Instantly share code, notes, and snippets.

@tonyarnold
Created July 26, 2009 15:08
Show Gist options
  • Save tonyarnold/155790 to your computer and use it in GitHub Desktop.
Save tonyarnold/155790 to your computer and use it in GitHub Desktop.
NSNumber *windowLevelIndex = [[NSUserDefaults standardUserDefaults] objectForKey:@"DesktopBackgroundLevel"];
if (windowLevelIndex != nil) {
switch ([windowLevelIndex integerValue]) {
case 0: // Show behind the desktop icons, but on the desktop - ignored by Exposé
[window setLevel:kCGDesktopWindowLevel];
[window setIgnoresMouseEvents:YES];
[window orderBack:self];
break;
case 1: // Show above the desktop icons - still ignored by Exposé
[window setLevel:kCGDesktopIconWindowLevel];
[window setIgnoresMouseEvents:NO];
[window orderFront:self];
break;
default:
break;
}
}
[window clearExposeTags];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment