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

Unified Diff: ui/views/corewm/focus_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/focus_controller.h ('k') | ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/focus_controller.cc
diff --git a/ui/views/corewm/focus_controller.cc b/ui/views/corewm/focus_controller.cc
index eaab15101820708b88242137c2ffe4cd836e7915..ddaa65d467e7820cfb5ad3db41ddeacfd6b5f7f4 100644
--- a/ui/views/corewm/focus_controller.cc
+++ b/ui/views/corewm/focus_controller.cc
@@ -151,7 +151,7 @@ void FocusController::FocusWindow(aura::Window* window) {
// we must not adjust the focus below since this will clobber that change.
aura::Window* last_focused_window = focused_window_;
if (!updating_activation_)
- SetActiveWindow(activatable);
+ SetActiveWindow(window, activatable);
// If the window's ActivationChangeObserver shifted focus to a valid window,
// we don't want to focus the window we thought would be focused by default.
@@ -279,10 +279,21 @@ void FocusController::SetFocusedWindow(aura::Window* window) {
observer->OnWindowFocused(focused_window_, lost_focus);
}
-void FocusController::SetActiveWindow(aura::Window* window) {
- if (updating_activation_ || window == active_window_)
+void FocusController::SetActiveWindow(aura::Window* requested_window,
+ aura::Window* window) {
+ if (updating_activation_)
return;
+ if (window == active_window_) {
+ if (requested_window) {
+ FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver,
+ activation_observers_,
+ OnAttemptToReactivateWindow(requested_window,
+ active_window_));
+ }
+ return;
+ }
+
DCHECK(rules_->CanActivateWindow(window));
if (window)
DCHECK_EQ(window, rules_->GetActivatableWindow(window));
@@ -326,7 +337,7 @@ void FocusController::WindowLostFocusFromDispositionChange(
// that process so there's no point in updating focus independently.
if (window == active_window_) {
aura::Window* next_activatable = rules_->GetNextActivatableWindow(window);
- SetActiveWindow(next_activatable);
+ SetActiveWindow(NULL, next_activatable);
if (!(active_window_ && active_window_->Contains(focused_window_)))
SetFocusedWindow(next_activatable);
} else if (window->Contains(focused_window_)) {
« no previous file with comments | « ui/views/corewm/focus_controller.h ('k') | ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698