Can I change the visible border of NSScreen?

I am trying to create a toolbar which is at the top of the screen under the OS X panel.

I would not want any other application to be able to overlap my application when it was maximized. I can get the visible frame dimensions using the NFScreen visibleframe method, but can I change the visible frame to omit the size and position of my application?

+4
source share
2 answers

The simple answer is no, you cannot. I think the only way to change the visibleRect screen visibleRect be to introduce code into the AppKit and swizzle method.

Even then, it may not do what you need, because this method may not be what Apple uses to define a β€œsafe area” for windows and will almost certainly not work with Carbon applications.

Nothing you do with windows will change that.

What you can do is use the Accessibility framework to rearrange windows if you find that their frames have changed so that they overlap your toolbar window. Unfortunately, I think you may need a survey for this.

+4
source

Try setting your window level to NSDockWindowLevel .

This may not work, depending on whether the system reads all the windows at this level or only the Dock window, but it's worth a try.

+1
source

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


All Articles