NSWindow with NSWindowCollectionBehaviorStationary is displayed in the toolbar. This is mistake?

I am trying to get NSWindow for:

  • To be visible in all spaces
  • Be visible when showing the desktop (by pressing F11 )
  • Not visible in Mission Control / Expose

The following does just that, but with a side effect:

 [self setCollectionBehavior: NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorStationary ]; 

When you switch to the dashboard in Mac OS X Lion, the window remains visible alone with the dashboard elements for a second, then it is hidden.

Is this the expected behavior or error? My app users are confused to see a window on a toolbar before they disappear. I would expect them to only appear on Spaces, not on the toolbar.

+54
cocoa spaces nswindow
Nov 27 '11 at 11:14
source share
2 answers

I looked at http://cocoadev.com/wiki/DontExposeMe finding a workaround

nothing really works except.

 self.window.level = kCGDesktopWindowLevel; 

it is now possible to detect changes to expose and establish that then: ......

see How can I detect a mission control switch or Command-Tab by replacing my program in OS X? for this: maybe the answer will appear there

+3
Nov 13 '12 at 19:38
source share
β€” -

I was able to reproduce this behavior, and I think that this is just incorrect animation on the Apple side.

Just so that I can better explain this, create a new project, add these two lines to applicationDidFinishLaunching: and run it.

 [self.window setCollectionBehavior: NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorStationary ]; [self.window setHidesOnDeactivate: YES]; 

(self.window is a window that is automatically created when a new project is created. In any case, it does not matter until it appears on the screen)

Now pay attention to this behavior: when changing from one place where you can see your window on another, in which there are other windows from other applications (and therefore your window should disappear from the moment your application was deactivated), only your window disappears when the animation ends. So what is going on?

Here I think this happens: when switching from one space to another, the windows displayed in all spaces react only to a change after the animation , therefore, your window appears briefly on the dashboard, I think you will notice that it disappears accurately, when the slide animation ends.

So, unfortunately, I do not know how to fix your problem. This seems to be happening.

+1
Nov 01
source share



All Articles