Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: base/mac/mac_util.mm

Issue 13583005: Work around bug coming back from hiding menu bar with fullscreen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_util.mm
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 35c1949fa095c58dcd7ef552dad12c0feca51695..48b4e5a190a240cfb0ec115c27cf7d4a76cf7445 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -27,6 +27,16 @@
namespace base {
namespace mac {
+// Replicate specific 10.7 SDK declarations for building with prior SDKs.
+#if !defined(MAC_OS_X_VERSION_10_7) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+enum {
+ NSApplicationPresentationFullScreen = 1 << 10
+};
+
+#endif // MAC_OS_X_VERSION_10_7
+
namespace {
// The current count of outstanding requests for full screen mode from browser
@@ -60,6 +70,17 @@ void SetUIMode() {
NSApplicationPresentationHideMenuBar;
}
+ // Bug-fix: if the window is fullscreened (Lion-style) and
+ // NSApplicationPresentationDefault is requested, the result is that the menu
+ // bar doesn't auto-hide. In that case, explicitly set the presentation
+ // options to the ones that are set by the system as it fullscreens a window.
Nico 2013/04/03 22:16:07 file rdar
+ if (desired_options == NSApplicationPresentationDefault &&
+ current_options & NSApplicationPresentationFullScreen) {
+ desired_options |= NSApplicationPresentationFullScreen |
+ NSApplicationPresentationAutoHideMenuBar |
+ NSApplicationPresentationAutoHideDock;
+ }
+
if (current_options != desired_options)
[NSApp setPresentationOptions:desired_options];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698