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

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: nits 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
« no previous file with comments | « ash/wm/workspace_controller.h ('k') | ui/aura/client/activation_change_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 (ash::Shell::GetInstance()->IsSystemModalWindowOpen()) {
66 // While a system model dialog is showing requests to activate a window
67 // other than that of the modal dialog fail. Outside of this function we
68 // only switch the active workspace when activation changes. That prevents
69 // the active workspace from changing while a system modal dialog is
70 // showing. This code ensures the active workspace changes even though
71 // activation doesn't change away from the system model dialog.
72 workspace_manager_->SetActiveWorkspaceByWindow(request_active);
73 }
74 }
75
61 } // namespace internal 76 } // namespace internal
62 } // namespace ash 77 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace_controller.h ('k') | ui/aura/client/activation_change_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698