I have 2 NSWindows (both without title bar) that gets displayed right beneath a Status Bar item after it is clicked. Inside the first NSWindow I have a button to start the flipping animation to the second NSWindow and vice versa.
Here is the code that I use to make the flipping animation:
I also have the windowDidResignKey: method so, when one of the NSWindow loses focus I close both windows inside the method.
So here’s the problem:
- I click on the status bar item and the first
NSWindowis displayed - I click the button to perform the flipping animation (the flipping animation is displayed without any problems) to the second window
- I switch from the current space to another space (this triggers the
windowDidResignKey:method) - I click, again, on the status bar item and the second
NSWindowis displayed - I click on the button of the 2nd window to perform the flipping animation to the first window but the animation is not displayed correctly. The second window disappears, nothing appears for a second or two and the first window appears (the animation is performed, it’s just not visible)
- But if I go the first space (where I first performed the first flipping animation) the animation is performed correctly, without any errors.
I think that this error is caused by something like: one window is in one space and another one is in another space (because of the windowDidResignKey: method).
Any ideas on how to fix this? I’ve tried change both NSWindows to ‘Can Join All Spaces’ and ‘Move To Active Space’ but without any success.
Thanks!
Solved the problem, and updated the library.
The container window, responsible for flipping, needs to be movable between spaces, and automatically move to the active space. I simply added
to
+ (NSWindow *)flippingContainerWindow