Chromium Code Reviews| Index: ash/wm/workspace_controller.cc |
| diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc |
| index c880663ac8c3c7de9b4c9084f953f65a5a55f842..d75b533e282cf0854b1a9e3caba05323bbeadc26 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/shell.h" |
| #include "ash/wm/window_util.h" |
| #include "ash/wm/workspace/workspace_manager.h" |
| #include "ui/aura/client/activation_client.h" |
| @@ -58,5 +59,21 @@ void WorkspaceController::OnWindowActivated(aura::Window* gained_active, |
| } |
| } |
| +void WorkspaceController::OnAttemptToReactivateWindow( |
| + aura::Window* request_active, |
| + aura::Window* actual_active) { |
| + if (request_active == actual_active) |
|
sky
2013/04/24 14:14:53
Why do we need this check? It seems like the only
sschmitz
2013/04/24 15:42:04
Done.
|
| + return; |
| + if (ash::Shell::GetInstance()->IsSystemModalWindowOpen()) { |
| + // While a system model dialog is showing requests to activate a window |
| + // other than that of the modal dialog fail. Outside of this function we |
| + // only switch the active workspace when activation changes. That prevents |
| + // the active workspace from changing while a system modal dialog is |
| + // showing. This code ensures the active workspace changes even though |
| + // activation doesn't change away from the system model dialog. |
| + workspace_manager_->SetActiveWorkspaceByWindow(request_active); |
| + } |
| +} |
| + |
| } // namespace internal |
| } // namespace ash |