Index: ash/wm/workspace_controller.cc |
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc |
index 8d378581401f3bc96bfff2a02e09dc97dcd21377..fd5fbecfa9374f938288ab910d2dbb5191edd3eb 100644 |
--- a/ash/wm/workspace_controller.cc |
+++ b/ash/wm/workspace_controller.cc |
@@ -4,6 +4,7 @@ |
#include "ash/wm/workspace_controller.h" |
+#include "ash/root_window_controller.h" |
#include "ash/shelf/shelf_layout_manager.h" |
#include "ash/shell.h" |
#include "ash/shell_window_ids.h" |
@@ -57,6 +58,12 @@ WorkspaceController::~WorkspaceController() { |
WorkspaceWindowState WorkspaceController::GetWindowState() const { |
if (!shelf_) |
return WORKSPACE_WINDOW_STATE_DEFAULT; |
+ const aura::Window* topmost_fullscreen_window = GetRootWindowController( |
+ viewport_->GetRootWindow())->GetTopmostFullscreenWindow(); |
+ if (topmost_fullscreen_window && |
+ !wm::GetWindowState(topmost_fullscreen_window)->ignored_by_shelf()) { |
+ return WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
+ } |
const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
const aura::Window::Windows& windows(viewport_->children()); |
@@ -74,8 +81,6 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const { |
// An untracked window may still be fullscreen so we keep iterating when |
// we hit a maximized window. |
has_maximized_window = true; |
pkotwicz
2013/12/05 02:46:29
We can return WORKSPACE_WINDOW_STATE_MAXIMIZED imm
flackr
2013/12/05 16:48:54
Nice, the code is getting cleaner and cleaner :-).
|
- } else if (window_state->IsFullscreen()) { |
- return WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
} |
if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds)) |
window_overlaps_launcher = true; |