Tuesday 15 January 2013

objective c - NSApplicationPresentationHideDock has no effect -



objective c - NSApplicationPresentationHideDock has no effect -

i have window want able take fullscreen without allowing access dock or menu bar.

i enabling fullscreen back upwards setting window collection behavior nswindowcollectionbehaviorfullscreenprimary. have tried setting collection behavior in both ib , calling setcollectionbehavior: straight , has no effect on issue.

my window delegate responds window:willusefullscreenpresentationoptions: returning options nsapplicationpresentationfullscreen | nsapplicationpresentationhidedock | nsapplicationpresentationhidemenubar

the window has fullscreen button available in titlebar , moves in , out of fullscreen mode fine know have setup fullscreen back upwards correctly.

the menu bar behaves supposed based on presentation options provide.

the dock how ever different story, acting if passed auto hide alternative , slide view when move mouse bottom of screen no matter alternative provide in window:willusefullscreenpresentationoptions:

it odd hidden menu bar auto hide dock, , if homecoming equivalent combination of flags (nsapplicationpresentationautohidedock | nsapplicationpresentationhidemenubar) in window:willusefullscreenpresentationoptions: exception saying combination not valid.

am missing something?

update 1:

tried on os x 10.8 , works docs indicate should. on os x 10.9 , os x 10.10 fails every time. tried apple's sample code project "fullscreenwindow" specifies flags , fails hide dock on 10.9 , 10.10, works perfect on 10.8.

i think may apple bug, either problem feature or, if deprecated feature documentation bug since not indicated anywhere.

i have logged apple.

update 2:

found solution!

it seems must not provide windows presentation options. seems application has own presentation options override windows options.

added window delegate , works.

- (void)windowwillenterfullscreen:(nsnotification*)notification { [[nsapplication sharedapplication] setpresentationoptions:nsapplicationpresentationhidemenubar | nsapplicationpresentationhidedock]; } - (void)windowdidexitfullscreen:(nsnotification*)notification { [[nsapplication sharedapplication] setpresentationoptions:nsapplicationpresentationdefault]; }

here solution.

it seems must not provide windows presentation options. seems application has own presentation options override windows options.

added window delegate , works.

- (void)windowwillenterfullscreen:(nsnotification*)notification { [[nsapplication sharedapplication] setpresentationoptions:nsapplicationpresentationhidemenubar | nsapplicationpresentationhidedock]; } - (void)windowdidexitfullscreen:(nsnotification*)notification { [[nsapplication sharedapplication] setpresentationoptions:nsapplicationpresentationdefault]; }

objective-c osx cocoa nswindow

No comments:

Post a Comment