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

Side by Side Diff: ash/wm/workspace_controller.cc

Issue 14222019: Trying to activate a window in a workspace other than the current is ignored while a system modal d… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: focus controller unittest Created 7 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace_controller.h" 5 #include "ash/wm/workspace_controller.h"
6 6
7 #include "ash/shell.h"
7 #include "ash/wm/window_util.h" 8 #include "ash/wm/window_util.h"
8 #include "ash/wm/workspace/workspace_manager.h" 9 #include "ash/wm/workspace/workspace_manager.h"
9 #include "ui/aura/client/activation_client.h" 10 #include "ui/aura/client/activation_client.h"
10 #include "ui/aura/client/aura_constants.h" 11 #include "ui/aura/client/aura_constants.h"
11 #include "ui/aura/root_window.h" 12 #include "ui/aura/root_window.h"
12 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
13 14
14 namespace ash { 15 namespace ash {
15 namespace internal { 16 namespace internal {
16 17
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 52 }
52 53
53 void WorkspaceController::OnWindowActivated(aura::Window* gained_active, 54 void WorkspaceController::OnWindowActivated(aura::Window* gained_active,
54 aura::Window* lost_active) { 55 aura::Window* lost_active) {
55 if (!gained_active || 56 if (!gained_active ||
56 gained_active->GetRootWindow() == viewport_->GetRootWindow()) { 57 gained_active->GetRootWindow() == viewport_->GetRootWindow()) {
57 workspace_manager_->SetActiveWorkspaceByWindow(gained_active); 58 workspace_manager_->SetActiveWorkspaceByWindow(gained_active);
58 } 59 }
59 } 60 }
60 61
62 void WorkspaceController::OnAttemptToReactivateWindow(
63 aura::Window* request_active,
64 aura::Window* actual_active) {
65 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.
66 return;
67 if (ash::Shell::GetInstance()->IsSystemModalWindowOpen()) {
68 // While a system model dialog is showing requests to activate a window
69 // other than that of the modal dialog fail. Outside of this function we
70 // only switch the active workspace when activation changes. That prevents
71 // the active workspace from changing while a system modal dialog is
72 // showing. This code ensures the active workspace changes even though
73 // activation doesn't change away from the system model dialog.
74 workspace_manager_->SetActiveWorkspaceByWindow(request_active);
75 }
76 }
77
61 } // namespace internal 78 } // namespace internal
62 } // namespace ash 79 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698