Here are my goals:
- My application displays an overlay window above all applications' windows.
- The user can draw in the overlay window.
- The mouse cursor changes to a specific cursor while in the overlay window.
- The application that has the active appearance before summoning the overlay window still has it while the overlay window is up and usable.
- The user does not need to click on the overlay window to activate it before they can draw.
- 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]
inmouseDown:
[NSApp activateIgnoringOtherApps:YES]
inapplicationWillFinishLaunching:
[myWindow orderFront:nil]
inapplicationWillFinishLaunching:
[myWindow makeKeyAndOrderFront:nil]
inapplicationWillFinishLaunching:
[myWindow orderFrontRegardless]
inapplicationWillFinishLaunching:
[myWindow makeMainWindow]
inapplicationWillFinishLaunching:
(this caused failure of point 4 even with LSBackgroundOnly)SetThemeCursor
inapplicationWillFinishLaunching:
- (With LSUIElement) Implementing
canBecomeMainWindow
in my NSPanel subclass to returnNO
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?