cocoa coder
cocoa coder

Reputation: 214

Hide Mac desktop icons with fade effect?

Is it possible to hide or unhide the desktop icons on a Mac with a fade effect? This could be potentially done by placing a image of the wallpaper over the actual desktop, so that when the desktop is clicked, the icons would appear.

Could an approch like this be sandboxed?

Upvotes: 1

Views: 863

Answers (2)

omz
omz

Reputation: 53561

The basic approach would be to create a borderless NSWindow with an appropriate level. kCGDesktopIconWindowLevelKey is the level of the desktop icons, so that should work.

Sandboxing is not a problem for this because you don't actually remove the desktop icons, you just display a window on top of them.

You'll probably also want to set the collectionBehavior of the window to NSWindowCollectionBehaviorStationary, so that it's not affected by Exposé.

Upvotes: 3

Charlie
Charlie

Reputation: 11787

I'm not sure if this is possible, because:

  1. The overlay would have to be over the desktop, but under new windows
  2. This would most likely not be able to be sandboxed

But if you could it to work, the workflow would be along the lines of:

  1. User clicks button (preferably menubar, as this app doesn't really have a window)
  2. A full screen window (with UI elements disabled, such as menubar) fades in with the background image set as the Mac's background image
  3. Clicking the button again would hide the window

Upvotes: 0

Related Questions