Add NSWindow in front of full screen application

I want to have a window in front of all other applications. I want this window to appear on the keyword label, for example, in the Alfred application.

I try a lot of solutions, but nothing works for NSWindow in front of a full-screen application on the main or second screen.

I tried the classics:

[self.window setLevel:NSMainMenuWindowLevel + 1];
[self.window setCollectionBehavior:NSWindowCollectionBehaviorStationary|NSWindowCollectionBehaviorCanJoinAllSpaces|NSWindowCollectionBehaviorFullScreenAuxiliary];
[self.window setHidesOnDeactivate:NO];

It works, except with a full-screen application.

Works with NSPanel with [self.videoWindow setStyleMask: NSBorderlessWindowMask]; but only on the main screen.

Anyone have a solution? Alfred is developing around?

+4
source share
3 answers

. Windows . . , Application Agent info.plist YES.

+3

, , , , , NSMainMenuWindowLevel + 1, CGShieldingWindowLevel()+1

Quartz Debug Apple ( ).

Quartz Debug , , , - , , , ( , - ).

0

:

  • self.collectionBehavior = NSWindowCollectionBehaviorMoveToActiveSpace | NSWindowCollectionBehaviorFullScreenAuxiliary;
  • [NSApp activateblabla];
  • LSUIElement - TransformProcessType

, , Dock. , , Dock.

0

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


All Articles