| Index: ash/wm/workspace_controller.cc
|
| diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
|
| index 64a23a94fb3d71b7b70f568d74c752c856f7a3e4..c03edf1aceb2390529bfab8022254b6ceb2d488f 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())->GetWindowForFullscreenMode();
|
| + if (topmost_fullscreen_window &&
|
| + !wm::GetWindowState(topmost_fullscreen_window)->ignored_by_shelf()) {
|
| + return WORKSPACE_WINDOW_STATE_FULL_SCREEN;
|
| + }
|
|
|
| // These are the container ids of containers which may contain windows that
|
| // may overlap the launcher shelf and affect its transparency.
|
| @@ -66,7 +73,6 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
|
| };
|
| const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
|
| bool window_overlaps_launcher = false;
|
| - bool has_maximized_window = false;
|
| for (size_t idx = 0; idx < arraysize(kWindowContainerIds); idx++) {
|
| const aura::Window* container = Shell::GetContainer(
|
| viewport_->GetRootWindow(), kWindowContainerIds[idx]);
|
| @@ -77,21 +83,14 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
|
| if (window_state->ignored_by_shelf())
|
| continue;
|
| ui::Layer* layer = (*i)->layer();
|
| - if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f)
|
| + if (!layer->GetTargetVisibility())
|
| continue;
|
| - if (window_state->IsMaximized()) {
|
| - // An untracked window may still be fullscreen so we keep iterating when
|
| - // we hit a maximized window.
|
| - has_maximized_window = true;
|
| - } else if (window_state->IsFullscreen()) {
|
| - return WORKSPACE_WINDOW_STATE_FULL_SCREEN;
|
| - }
|
| + if (window_state->IsMaximized())
|
| + return WORKSPACE_WINDOW_STATE_MAXIMIZED;
|
| if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds))
|
| window_overlaps_launcher = true;
|
| }
|
| }
|
| - if (has_maximized_window)
|
| - return WORKSPACE_WINDOW_STATE_MAXIMIZED;
|
|
|
| return window_overlaps_launcher ?
|
| WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF :
|
|
|