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

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: reduced 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
« ui/views/corewm/focus_controller.h ('K') | « ui/views/corewm/focus_controller.h ('k') | no next file » | 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..a4a8d33401fdc10e06246f530834c69e21ecf66c 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,19 @@ 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_) {
+ FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver,
sky 2013/04/23 21:36:42 I think it's only worth invoking this when request
sschmitz 2013/04/24 01:23:43 Done.
+ activation_observers_,
+ OnAttemptToReactivateWindow(requested_window,
+ active_window_));
+ return;
+ }
+
DCHECK(rules_->CanActivateWindow(window));
if (window)
DCHECK_EQ(window, rules_->GetActivatableWindow(window));
@@ -326,7 +335,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_)) {
« ui/views/corewm/focus_controller.h ('K') | « ui/views/corewm/focus_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698