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

Unified Diff: chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm

Issue 2351283004: [Mac] Fix for the fullscreen toolbar issue with Active Spaces (Closed)
Patch Set: Created 4 years, 3 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: chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm
diff --git a/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm b/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm
index b55f5d3423274f5a6df096fd925ab55058b7dfc6..5138fdaead80f8b254ebe32c82098586765c507e 100644
--- a/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm
@@ -240,6 +240,13 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
selector:@selector(windowDidResignMain:)
name:NSWindowDidResignMainNotification
object:window];
+
+ // Register for Active Space change notifications.
+ [[[NSWorkspace sharedWorkspace] notificationCenter]
+ addObserver:self
+ selector:@selector(activeSpaceDidChange:)
+ name:NSWorkspaceActiveSpaceDidChangeNotification
+ object:nil];
}
- (void)exitFullscreenMode {
@@ -265,6 +272,12 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
[self updateMenuBarAndDockVisibility];
}
+- (void)activeSpaceDidChange:(NSNotification*)notification {
+ menubarFraction_ = kHideFraction;
+ menubarState_ = FullscreenMenubarState::HIDDEN;
+ [browserController_ layoutSubviews];
+}
+
- (CGFloat)floatingBarVerticalOffset {
return kFloatingBarVerticalOffset;
}
@@ -477,6 +490,10 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
if (![self isMouseOnScreen] && progress > menubarFraction_)
return;
+ // Ignore the menubarFraction changes if the Space is inactive.
+ if (![[browserController_ window] isOnActiveSpace])
+ return;
+
if (IsCGFloatEqual(progress, kShowFraction))
menubarState_ = FullscreenMenubarState::SHOWN;
else if (IsCGFloatEqual(progress, kHideFraction))
@@ -635,6 +652,7 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
- (void)cleanup {
[self cancelAnimationAndTimer];
[[NSNotificationCenter defaultCenter] removeObserver:self];
+ [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
[self removeTrackingAreaIfNecessary];
« 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