Index: chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
index f28d1a71bdbfd124d5649925b56c35faf508ebb4..efccc3daec3060ea823ddfd14b5516c09f361aaf 100644 |
--- a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
@@ -849,13 +849,17 @@ NSCursor* LoadWebKitCursor(WebKit::WebCursorInfo::Type type) { |
- (void)fullScreenModeChanged:(bool)isFullScreen { |
[self updateWindowLevel]; |
- // The full-screen window is in normal level and changing the panel window to |
- // same normal level will not move it below the full-screen window. Thus we |
- // need to reorder the panel window. |
- if (isFullScreen) |
- [[self window] orderBack:nil]; |
- else |
- [[self window] orderFrontRegardless]; |
+ // If the panel is not always on top, its z-order should not be affected if |
+ // some other window enters fullscreen mode. |
+ if (windowShim_->panel()->IsAlwaysOnTop()) { |
+ // The full-screen window is in normal level and changing the panel window |
+ // to same normal level will not move it below the full-screen window. Thus |
+ // we need to reorder the panel window. |
+ if (isFullScreen) |
+ [[self window] orderBack:nil]; |
+ else |
+ [[self window] orderFrontRegardless]; |
+ } |
} |
- (BOOL)canBecomeKeyWindow { |