3

I'm having this problem on OSX Lion when entering/exiting fullscreen. I tried to reapply the style mask without success:

NSUInteger styleMask = NSResizableWindowMask | NSClosableWindowMask |  NSMiniaturizableWindowMask | NSTitledWindowMask;
styleMask |= NSTexturedBackgroundWindowMask;

window = [[NSWindow alloc] initWithContentRect:windowFrame 
                                      styleMask: styleMask
                                        backing:NSBackingStoreBuffered 
                                          defer:NO];

and the fullscreen notification

(void)didExitFull:(NSNotification *)notification {
   NSUInteger styleMask=[window styleMask];
   [window setStyleMask:styleMask|NSMiniaturizableWindowMask];

}

It seems that the miniaturize button is not getting enable again. I also found this UI Usability problems on MacOSX 10.6 here

leppie
  • 115,091
  • 17
  • 196
  • 297
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
  • I went further and realized that for some reason the miniaturize button was just in disabled state. So adding `code`[[window standardWindowButton:NSWindowMiniaturizeButton] setEnabled:YES]; `code` will activate the button again. The problem is that this happens only when the window updates itself gaining focus from back to frontmost. – loretoparisi Oct 25 '11 at 12:34

1 Answers1

2

Please override the following function

- (NSApplicationPresentationOptions) window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
{
    return (proposedOptions| NSApplicationPresentationAutoHideToolbar);
}

And do not set styleMask after exitFullscreen. Let the system do it.

Black Coder
  • 197
  • 1
  • 5