OSX that runs without active

I recently tried the ColorSnapper app, and I noticed that it works while supporting other apps.

(Check the screen below, as you can see that the safari window is still active, and ColorSnapper is still active).

enter image description here

How can this effect be reproduced?

+4
source share
3 answers

I believe that these types of applications use LSBackgroundOnly or LSUIElement as application launch keys in their plist ( reference ) files.

Here are some more details about this.

+3
source

I just try and LSBackgroundOnly is the solution, but you have to set the window level.

Example:

 [mySpecialNSWindow setLevel:NSMainMenuWindowLevel]; 

This will display a special window above the windows of other applications.

+2
source

I believe that the right approach is the mixture (1) that makes the LSBackgroundOnly application, (2) using a custom transparent window, as described here and set its level to NSFloatingWindowLevel, (3) using something like this in the application’s deletion to control movements mouse, although your application is inactive and, for example, allows your window to follow the position of the mouse:

 [NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask handler:^(NSEvent *event) { [window setFrameOrigin:[NSEvent mouseLocation]]; }]; 

In the (transparent) window, you can view the views as you like, move them and change its contents according to the position of the mouse.

+1
source

Source: https://habr.com/ru/post/1411953/


All Articles