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

Side by Side Diff: ash/shell.cc

Issue 2070163002: Fix "modal isn't modal in multi displays" issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modal fix Created 4 years, 6 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 aura::client::SetEventClient(root_window, event_client_.get()); 1196 aura::client::SetEventClient(root_window, event_client_.get());
1197 1197
1198 aura::client::SetWindowMoveClient(root_window, 1198 aura::client::SetWindowMoveClient(root_window,
1199 toplevel_window_event_handler_.get()); 1199 toplevel_window_event_handler_.get());
1200 root_window->AddPreTargetHandler(toplevel_window_event_handler_.get()); 1200 root_window->AddPreTargetHandler(toplevel_window_event_handler_.get());
1201 root_window->AddPostTargetHandler(toplevel_window_event_handler_.get()); 1201 root_window->AddPostTargetHandler(toplevel_window_event_handler_.get());
1202 } 1202 }
1203 1203
1204 bool Shell::CanWindowReceiveEvents(aura::Window* window) { 1204 bool Shell::CanWindowReceiveEvents(aura::Window* window) {
1205 RootWindowControllerList controllers = GetAllRootWindowControllers(); 1205 RootWindowControllerList controllers = GetAllRootWindowControllers();
1206 for (RootWindowControllerList::iterator iter = controllers.begin(); 1206 for (RootWindowController* controller : controllers) {
1207 iter != controllers.end(); ++iter) { 1207 if (controller->CanWindowReceiveEvents(window))
1208 SystemModalContainerLayoutManager* layout_manager =
1209 (*iter)->GetSystemModalLayoutManager(window);
1210 if (layout_manager && layout_manager->CanWindowReceiveEvents(window))
1211 return true;
1212 // Allow events to fall through to the virtual keyboard even if displaying
1213 // a system modal dialog.
1214 if ((*iter)->IsVirtualKeyboardWindow(window))
1215 return true; 1208 return true;
1216 } 1209 }
1217
1218 return false; 1210 return false;
1219 } 1211 }
1220 1212
1221 //////////////////////////////////////////////////////////////////////////////// 1213 ////////////////////////////////////////////////////////////////////////////////
1222 // Shell, ui::EventTarget overrides: 1214 // Shell, ui::EventTarget overrides:
1223 1215
1224 bool Shell::CanAcceptEvent(const ui::Event& event) { 1216 bool Shell::CanAcceptEvent(const ui::Event& event) {
1225 return true; 1217 return true;
1226 } 1218 }
1227 1219
(...skipping 15 matching lines...) Expand all
1243 1235
1244 void Shell::OnWindowActivated( 1236 void Shell::OnWindowActivated(
1245 aura::client::ActivationChangeObserver::ActivationReason reason, 1237 aura::client::ActivationChangeObserver::ActivationReason reason,
1246 aura::Window* gained_active, 1238 aura::Window* gained_active,
1247 aura::Window* lost_active) { 1239 aura::Window* lost_active) {
1248 if (gained_active) 1240 if (gained_active)
1249 target_root_window_ = gained_active->GetRootWindow(); 1241 target_root_window_ = gained_active->GetRootWindow();
1250 } 1242 }
1251 1243
1252 } // namespace ash 1244 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698