• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Child windows appear to move when entering full-screen mode / how to detect full-screen transition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Child windows appear to move when entering full-screen mode / how to detect full-screen transition


  • Subject: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
  • From: Michael Crawford <email@hidden>
  • Date: Fri, 13 Jan 2012 15:47:12 -0500

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

  • Follow-Ups:
    • Re: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
      • From: Lee Ann Rucker <email@hidden>
  • Prev by Date: Re: LSSharedFileListInsertItemURL/SMLoginItemSetEnabled and sandbox
  • Next by Date: Re: Core Data nested managed object contexts and frequent deadlocks
  • Previous by thread: MAX parsing (Re: TBXML question)
  • Next by thread: Re: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
  • Index(es):
    • Date
    • Thread