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

Unified 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698