From 6822bb6669f875831b2cdc959cd5c1db44677537 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 10 Jun 2015 13:13:49 +1200 Subject: [PATCH] Bug 1172664 - Use [NSApplication setPresentationOptions:] instead of SetSystemUIMode for hide os chrome. r=smichaud --HG-- extra : source : 2508b0bb8b91a883e39a1026364bab0947266288 --- widget/cocoa/nsCocoaUtils.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/widget/cocoa/nsCocoaUtils.mm b/widget/cocoa/nsCocoaUtils.mm index a31753ba0c27..c75958764031 100644 --- a/widget/cocoa/nsCocoaUtils.mm +++ b/widget/cocoa/nsCocoaUtils.mm @@ -253,15 +253,15 @@ void nsCocoaUtils::HideOSChromeOnScreen(bool aShouldHide, NSScreen* aScreen) NS_ASSERTION(sDockHiddenCount >= 0, "Unbalanced HideMenuAndDockForWindow calls"); } - // TODO This should be upgraded to use [NSApplication setPresentationOptions:] - // when support for 10.5 is dropped. + NSApplicationPresentationOptions options; if (sMenuBarHiddenCount > 0) { - ::SetSystemUIMode(kUIModeAllHidden, 0); + options = NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar; } else if (sDockHiddenCount > 0) { - ::SetSystemUIMode(kUIModeContentHidden, 0); + options = NSApplicationPresentationHideDock; } else { - ::SetSystemUIMode(kUIModeNormal, 0); + options = NSApplicationPresentationDefault; } + [NSApp setPresentationOptions:options]; NS_OBJC_END_TRY_ABORT_BLOCK; }