I have an app that is using borderless child windows to suspend controls over
an instance of NSScrollView. When entering full-screen (on Lion) the child
windows appear to move, I assume to make sure they are within the confines of
the parent window and full-screen dimensions.
I tried to compensate for this by manually verifying and reseting the relative
position of the child windows once the transition occurs. Only my attempts to
detect and react to this transition have failed. I've tried the following all
of which never get invoked:
- (void)applicationDidChangeScreenParameters:(NSNotification*)notification
{
MCLogFuncEntry();
// update child window relative positions
[self.bannerWindow setFrameOrigin:NSMakePoint(self.window.frame.origin.x +
kBannerWindowOrigin.x,
self.window.frame.origin.y +
kBannerWindowOrigin.y)];
[self.buttonWindow setFrameOrigin:NSMakePoint(self.window.frame.origin.x +
kButtonWindowOrigin.x,
self.window.frame.origin.y +
kButtonWindowOrigin.y)];
}
- (NSSize)window:(NSWindow*)window
willUseFullScreenContentSize:(NSSize)proposedSize
{
MCLogFuncEntry();
if ( window == self.window )
{
// update child window relative positions
[self.bannerWindow
setFrameOrigin:NSMakePoint(self.window.frame.origin.x + kBannerWindowOrigin.x,
self.window.frame.origin.y + kBannerWindowOrigin.y)];
[self.buttonWindow
setFrameOrigin:NSMakePoint(self.window.frame.origin.x + kButtonWindowOrigin.x,
self.window.frame.origin.y + kButtonWindowOrigin.y)];
}
return NSMakeSize(kImageWidth, kImageHeight);
}
- (NSApplicationPresentationOptions)window:(NSWindow*)window
willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
{
if ( NO == [[NSUserDefaults standardUserDefaults] developerMode] )
{
NSApplicationPresentationOptions options =
NSApplicationPresentationDisableAppleMenu |
NSApplicationPresentationDisableHideApplication |
NSApplicationPresentationDisableProcessSwitching |
NSApplicationPresentationFullScreen |
NSApplicationPresentationHideDock |
NSApplicationPresentationHideMenuBar;
if ( proposedOptions != options )
{
return options;
}
}
return proposedOptions;
}
- (void)windowDidResize:(NSNotification*)notification
{
MCLogFuncEntry(); // just wanted to see if this gets called through the
delegate. Nope.
}
So, how can I be notification when entering or exiting full-screen mode on
Lion. Any insights on why the windows move would also be greatly appreciated.
The current document on NSWindow is out of date for Lion. I can only find
WinPanel.pdf dated 2009-11-27.
-Michael
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]