Re: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
Re: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
- Subject: Re: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
- From: Lee Ann Rucker <email@hidden>
- Date: Fri, 13 Jan 2012 16:37:32 -0800
http://developer.apple.com/library/mac/#documentation/cocoa/reference/NSWindowDelegate_Protocol/Reference/Reference.html
windowWillEnterFullScreen: etc.
Also I recommend http://developer.apple.com/library/mac/#samplecode/FullScreenWindow/Introduction/Intro.html
Sketch+Fullscreen is also useful, but that seems to have vanished.
On Jan 13, 2012, at 12:47 PM, Michael Crawford wrote:
> 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@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden