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

Side by Side Diff: ash/display/window_tree_host_manager.cc

Issue 1631023002: Fix moving the mouse between two displays after the secondary display becomes primary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 11 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/display/window_tree_host_manager.h" 5 #include "ash/display/window_tree_host_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 primary_display_id = new_primary_display.id(); 450 primary_display_id = new_primary_display.id();
451 GetDisplayManager()->layout_store()->UpdatePrimaryDisplayId( 451 GetDisplayManager()->layout_store()->UpdatePrimaryDisplayId(
452 display_manager->GetCurrentDisplayIdPair(), primary_display_id); 452 display_manager->GetCurrentDisplayIdPair(), primary_display_id);
453 453
454 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(primary_host), 454 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(primary_host),
455 old_primary_display.GetWorkAreaInsets()); 455 old_primary_display.GetWorkAreaInsets());
456 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(non_primary_host), 456 UpdateWorkAreaOfDisplayNearestWindow(GetWindow(non_primary_host),
457 new_primary_display.GetWorkAreaInsets()); 457 new_primary_display.GetWorkAreaInsets());
458 458
459 // Update the dispay manager with new display info. 459 // Update the dispay manager with new display info.
460 std::vector<DisplayInfo> display_info_list;
461 display_info_list.push_back(
462 display_manager->GetDisplayInfo(primary_display_id));
463 display_info_list.push_back(
464 display_manager->GetDisplayInfo(ScreenUtil::GetSecondaryDisplay().id()));
465 GetDisplayManager()->set_force_bounds_changed(true); 460 GetDisplayManager()->set_force_bounds_changed(true);
466 GetDisplayManager()->UpdateDisplays(display_info_list); 461 GetDisplayManager()->UpdateDisplays();
stevenjb 2016/01/25 21:42:55 Can we now rename DisplayManager::UpdateDisplays(v
jdufault 2016/01/25 22:48:46 There are some tests that use the method. Given th
467 GetDisplayManager()->set_force_bounds_changed(false); 462 GetDisplayManager()->set_force_bounds_changed(false);
468 } 463 }
469 464
470 void WindowTreeHostManager::UpdateMouseLocationAfterDisplayChange() { 465 void WindowTreeHostManager::UpdateMouseLocationAfterDisplayChange() {
471 // If the mouse is currently on a display in native location, 466 // If the mouse is currently on a display in native location,
472 // use the same native location. Otherwise find the display closest 467 // use the same native location. Otherwise find the display closest
473 // to the current cursor location in screen coordinates. 468 // to the current cursor location in screen coordinates.
474 469
475 gfx::Point point_in_screen = Shell::GetScreen()->GetCursorScreenPoint(); 470 gfx::Point point_in_screen = Shell::GetScreen()->GetCursorScreenPoint();
476 gfx::Point target_location_in_native; 471 gfx::Point target_location_in_native;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 SetDisplayPropertiesOnHost(ash_host, display); 833 SetDisplayPropertiesOnHost(ash_host, display);
839 834
840 #if defined(OS_CHROMEOS) 835 #if defined(OS_CHROMEOS)
841 if (switches::ConstrainPointerToRoot()) 836 if (switches::ConstrainPointerToRoot())
842 ash_host->ConfineCursorToRootWindow(); 837 ash_host->ConfineCursorToRootWindow();
843 #endif 838 #endif
844 return ash_host; 839 return ash_host;
845 } 840 }
846 841
847 } // namespace ash 842 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698