fleshgolem
fleshgolem

Reputation: 1144

Having an NSWindow always stay in background while still accepting mouse events

I need to have an application, with exactly one window, that always stays behind any other possible applications, while still accepting mouse events (so you can draw on it)

I subclassed NSWindow to create a window with NSBorderlessWindowMask. I also did override canBecomeKeyWindow to always return NO, but that does not seem to help.

Any ideas on this?

Upvotes: 3

Views: 336

Answers (1)

fleshgolem
fleshgolem

Reputation: 1144

Problem solved.

[self setLevel:CGWindowLevelForKey(kCGDesktopWindowLevelKey+1)] did the trick!

Upvotes: 2

Related Questions