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

Unified Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 100903002: Ignore fullscreen windows which are behind other windows for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static cast. Created 7 years 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
Index: ash/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index a791db5b055c101253a64c3f1b541b18cc45162c..b02baae908de0e06abd7d7f7aa4cf0fdc2ec1468 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -72,7 +72,9 @@ WorkspaceLayoutManager::WorkspaceLayoutManager(aura::Window* window)
shelf_(NULL),
window_(window),
work_area_in_parent_(ScreenAsh::GetDisplayWorkAreaBoundsInParent(
- window->parent())) {
+ window->parent())),
+ is_fullscreen_(GetRootWindowController(
+ window->GetRootWindow())->GetWindowForFullscreenMode() != NULL) {
}
WorkspaceLayoutManager::~WorkspaceLayoutManager() {
@@ -85,7 +87,7 @@ void WorkspaceLayoutManager::SetShelf(internal::ShelfLayoutManager* shelf) {
void WorkspaceLayoutManager::OnWindowAddedToLayout(Window* child) {
AdjustWindowBoundsWhenAdded(wm::GetWindowState(child));
BaseLayoutManager::OnWindowAddedToLayout(child);
- UpdateDesktopVisibility();
+ UpdateShelfVisibility();
WindowPositioner::RearrangeVisibleWindowOnShow(child);
}
@@ -97,7 +99,7 @@ void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(Window* child) {
void WorkspaceLayoutManager::OnWindowRemovedFromLayout(Window* child) {
BaseLayoutManager::OnWindowRemovedFromLayout(child);
- UpdateDesktopVisibility();
+ UpdateShelfVisibility();
}
void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child,
@@ -106,13 +108,11 @@ void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child,
if (child->TargetVisibility()) {
WindowPositioner::RearrangeVisibleWindowOnShow(child);
} else {
- if (wm::GetWindowState(child)->IsFullscreen()) {
- ash::Shell::GetInstance()->NotifyFullscreenStateChange(
- false, child->GetRootWindow());
- }
+ if (wm::GetWindowState(child)->IsFullscreen())
+ UpdateFullscreenState();
WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child);
}
- UpdateDesktopVisibility();
+ UpdateShelfVisibility();
}
void WorkspaceLayoutManager::SetChildBounds(
@@ -135,7 +135,7 @@ void WorkspaceLayoutManager::SetChildBounds(
AdjustSnappedBounds(window_state, &child_bounds);
SetChildBoundsDirect(child, child_bounds);
}
- UpdateDesktopVisibility();
+ UpdateShelfVisibility();
}
void WorkspaceLayoutManager::OnDisplayWorkAreaInsetsChanged() {
@@ -157,6 +157,12 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
}
}
+void WorkspaceLayoutManager::OnWindowStackingChanged(aura::Window* window) {
+ BaseLayoutManager::OnWindowStackingChanged(window);
+ UpdateShelfVisibility();
+ UpdateFullscreenState();
+}
+
void WorkspaceLayoutManager::OnTrackedByWorkspaceChanged(
wm::WindowState* window_state,
bool old){
@@ -198,9 +204,7 @@ void WorkspaceLayoutManager::OnWindowShowTypeChanged(
if (old_state != new_state &&
(new_state == ui::SHOW_STATE_FULLSCREEN ||
old_state == ui::SHOW_STATE_FULLSCREEN)) {
- ash::Shell::GetInstance()->NotifyFullscreenStateChange(
- new_state == ui::SHOW_STATE_FULLSCREEN,
- window_state->window()->GetRootWindow());
+ UpdateFullscreenState();
}
UpdateBoundsFromShowState(window_state, old_state);
@@ -215,7 +219,7 @@ void WorkspaceLayoutManager::ShowStateChanged(
wm::WindowState* state,
ui::WindowShowState last_show_state) {
BaseLayoutManager::ShowStateChanged(state, last_show_state);
- UpdateDesktopVisibility();
+ UpdateShelfVisibility();
}
void WorkspaceLayoutManager::AdjustAllWindowsBoundsForWorkAreaChange(
@@ -296,11 +300,21 @@ void WorkspaceLayoutManager::AdjustWindowBoundsWhenAdded(
window->SetBounds(bounds);
}
-void WorkspaceLayoutManager::UpdateDesktopVisibility() {
+void WorkspaceLayoutManager::UpdateShelfVisibility() {
if (shelf_)
shelf_->UpdateVisibilityState();
}
+void WorkspaceLayoutManager::UpdateFullscreenState() {
+ bool is_fullscreen = GetRootWindowController(
+ window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL;
+ if (is_fullscreen != is_fullscreen_) {
+ ash::Shell::GetInstance()->NotifyFullscreenStateChange(
+ is_fullscreen, window_->GetRootWindow());
+ is_fullscreen_ = is_fullscreen;
+ }
+}
+
void WorkspaceLayoutManager::UpdateBoundsFromShowState(
wm::WindowState* window_state,
ui::WindowShowState last_show_state) {

Powered by Google App Engine
This is Rietveld 408576698