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

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: Add test that WorkspaceLayoutManager correctly notifies on fullscreen changes. 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..9f3dce046289a3c676b664475e2ae5a27984946f 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_(static_cast<bool>(GetRootWindowController(
+ window->GetRootWindow())->GetTopmostFullscreenWindow())) {
}
WorkspaceLayoutManager::~WorkspaceLayoutManager() {
@@ -106,10 +108,8 @@ 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();
@@ -157,6 +157,12 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
}
}
+void WorkspaceLayoutManager::OnWindowStackingChanged(aura::Window* window) {
+ BaseLayoutManager::OnWindowStackingChanged(window);
+ UpdateDesktopVisibility();
pkotwicz 2013/12/05 02:46:29 Can you please rename UpdateDesktopVisibility() to
flackr 2013/12/05 16:48:54 Done.
+ 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);
@@ -301,6 +305,16 @@ void WorkspaceLayoutManager::UpdateDesktopVisibility() {
shelf_->UpdateVisibilityState();
}
+void WorkspaceLayoutManager::UpdateFullscreenState() {
+ bool is_fullscreen = static_cast<bool>(GetRootWindowController(
pkotwicz 2013/12/05 02:46:29 Can you explicity check for NULL instead of the st
flackr 2013/12/05 16:48:54 Done.
+ window_->GetRootWindow())->GetTopmostFullscreenWindow());
+ 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