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

Unified Diff: ash/wm/workspace_controller.cc

Issue 93103003: Update shelf when overlapping dragged windows exist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snap_undock
Patch Set: Update shelf when overlapping dragged windows exist (test) 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
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/workspace_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace_controller.cc
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
index 8d378581401f3bc96bfff2a02e09dc97dcd21377..64a23a94fb3d71b7b70f568d74c752c856f7a3e4 100644
--- a/ash/wm/workspace_controller.cc
+++ b/ash/wm/workspace_controller.cc
@@ -58,27 +58,37 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
if (!shelf_)
return WORKSPACE_WINDOW_STATE_DEFAULT;
+ // These are the container ids of containers which may contain windows that
+ // may overlap the launcher shelf and affect its transparency.
+ const int kWindowContainerIds[] = {
+ internal::kShellWindowId_DefaultContainer,
+ internal::kShellWindowId_DockedContainer,
+ };
const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
- const aura::Window::Windows& windows(viewport_->children());
bool window_overlaps_launcher = false;
bool has_maximized_window = false;
- for (aura::Window::Windows::const_iterator i = windows.begin();
- i != windows.end(); ++i) {
- wm::WindowState* window_state = wm::GetWindowState(*i);
- if (window_state->ignored_by_shelf())
- continue;
- ui::Layer* layer = (*i)->layer();
- if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f)
- 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;
+ for (size_t idx = 0; idx < arraysize(kWindowContainerIds); idx++) {
+ const aura::Window* container = Shell::GetContainer(
+ viewport_->GetRootWindow(), kWindowContainerIds[idx]);
+ const aura::Window::Windows& windows(container->children());
+ for (aura::Window::Windows::const_iterator i = windows.begin();
+ i != windows.end(); ++i) {
+ wm::WindowState* window_state = wm::GetWindowState(*i);
+ if (window_state->ignored_by_shelf())
+ continue;
+ ui::Layer* layer = (*i)->layer();
+ if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f)
+ 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_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds))
+ window_overlaps_launcher = true;
}
- if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds))
- window_overlaps_launcher = true;
}
if (has_maximized_window)
return WORKSPACE_WINDOW_STATE_MAXIMIZED;
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/workspace_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698