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

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

Issue 11085053: Improving window auto management between workspaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 8 years, 2 months 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_manager2.cc
diff --git a/ash/wm/workspace/workspace_manager2.cc b/ash/wm/workspace/workspace_manager2.cc
index 68250c32e7386b5807d1e2583250fa5e2ab5bf86..c304f1b4d2741f6610881d1f2208508af42840c3 100644
--- a/ash/wm/workspace/workspace_manager2.cc
+++ b/ash/wm/workspace/workspace_manager2.cc
@@ -17,6 +17,7 @@
#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
+#include "ash/wm/workspace/auto_window_management.h"
#include "ash/wm/workspace/desktop_background_fade_controller.h"
#include "ash/wm/workspace/workspace_animations.h"
#include "ash/wm/workspace/workspace_layout_manager2.h"
@@ -593,10 +594,13 @@ void WorkspaceManager2::OnWindowAddedToWorkspace(Workspace2* workspace,
// to the workspace.
if (workspace == active_workspace_)
UpdateShelfVisibility();
+
+ RearrangeVisibleWindowOnShow(child);
}
void WorkspaceManager2::OnWillRemoveWindowFromWorkspace(Workspace2* workspace,
Window* child) {
+ RearrangeVisibleWindowOnHideOrRemove(child);
child->ClearProperty(kWorkspaceKey);
}
@@ -609,10 +613,16 @@ void WorkspaceManager2::OnWindowRemovedFromWorkspace(Workspace2* workspace,
void WorkspaceManager2::OnWorkspaceChildWindowVisibilityChanged(
Workspace2* workspace,
Window* child) {
- if (workspace->ShouldMoveToPending())
+ if (workspace->ShouldMoveToPending()) {
MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_VISIBILITY_CHANGED);
- else if (workspace == active_workspace_)
- UpdateShelfVisibility();
+ } else {
+ if (workspace == active_workspace_)
sky 2012/10/22 16:40:50 Is there a reason you need to do UpdateShelfVisibi
Mr4D (OOO till 08-26) 2012/10/22 20:27:23 Done. We'll see later what does not work.
+ UpdateShelfVisibility();
+ if (child->TargetVisibility())
+ RearrangeVisibleWindowOnShow(child);
+ else
+ RearrangeVisibleWindowOnHideOrRemove(child);
+ }
}
void WorkspaceManager2::OnWorkspaceWindowChildBoundsChanged(

Powered by Google App Engine
This is Rietveld 408576698