views:

32

answers:

0

Here are my goals:

  1. My application displays an overlay window above all applications' windows.
  2. The user can draw in the overlay window.
  3. The mouse cursor changes to a specific cursor while in the overlay window.
  4. The application that has the active appearance before summoning the overlay window still has it while the overlay window is up and usable.
  5. The user does not need to click on the overlay window to activate it before they can draw.
  6. Drawing in the window does not steal the active appearance away from the application that has it.

With LSUIElement, I get #1, #2, #3, and #5.

With LSBackgroundOnly, I get #1, #2, #4, and #6.

How can I satisfy all of these goals without installing an event tap and processing the mouse events myself?

Things I've tried:

  • [NSApp preventWindowOrdering] in mouseDown:
  • [NSApp activateIgnoringOtherApps:YES] in applicationWillFinishLaunching:
  • [myWindow orderFront:nil] in applicationWillFinishLaunching:
  • [myWindow makeKeyAndOrderFront:nil] in applicationWillFinishLaunching:
  • [myWindow orderFrontRegardless] in applicationWillFinishLaunching:
  • [myWindow makeMainWindow] in applicationWillFinishLaunching: (this caused failure of point 4 even with LSBackgroundOnly)
  • SetThemeCursor in applicationWillFinishLaunching:
  • (With LSUIElement) Implementing canBecomeMainWindow in my NSPanel subclass to return NO

Except where otherwise noted, none of these made any difference.

So, with LSUIElement, goals #4 and #6 remain; with LSBackgroundOnly, goals #3 and #5 remain. Any suggestions?