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

Unified Diff: ash/display/display_controller.cc

Issue 1119953002: Enable display rotation, magnifier in unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | ash/display/display_manager.h » ('j') | ash/host/ash_remote_window_tree_host_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index e28472e09f3fe91ec454f2b230fb52236df36750..7d8e549e403489e93b863e6558ba725a59cc65a0 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -17,6 +17,8 @@
#include "ash/host/ash_window_tree_host.h"
#include "ash/host/ash_window_tree_host_init_params.h"
#include "ash/host/root_window_transformer.h"
+#include "ash/magnifier/magnification_controller.h"
+#include "ash/magnifier/partial_magnification_controller.h"
#include "ash/root_window_controller.h"
#include "ash/root_window_settings.h"
#include "ash/screen_util.h"
@@ -367,9 +369,10 @@ aura::Window* DisplayController::GetRootWindowForDisplayId(int64 id) {
}
AshWindowTreeHost* DisplayController::GetAshWindowTreeHostForDisplayId(
- int64 id) {
- CHECK_EQ(1u, window_tree_hosts_.count(id));
- return window_tree_hosts_[id];
+ int64 display_id) {
+ CHECK_EQ(1u, window_tree_hosts_.count(display_id))
+ << "display id = " << display_id;
+ return window_tree_hosts_[display_id];
}
void DisplayController::CloseChildWindows() {
@@ -589,6 +592,10 @@ void DisplayController::UpdateMouseLocationAfterDisplayChange() {
::wm::ConvertPointToScreen(dst_root_window, &target_location_in_screen);
const gfx::Display& target_display =
display_manager->FindDisplayContainingPoint(target_location_in_screen);
+ // If the original location isn't on any of new display, let ozone move
+ // the cursor.
+ if (!target_display.is_valid())
+ return;
oshima 2015/05/05 15:32:13 this was ozone issue.
int64 target_display_id = target_display.id();
// Do not move the cursor if the cursor's location did not change. This avoids
@@ -641,6 +648,14 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) {
AddWindowTreeHostForDisplay(display, AshWindowTreeHostInitParams());
RootWindowController::CreateForSecondaryDisplay(ash_host);
+ // Magnifier controllers keep pointers to the current root window.
+ // Update them here to avoid accessing them later.
+ Shell::GetInstance()->magnification_controller()->SwitchTargetRootWindow(
+ ash_host->AsWindowTreeHost()->window(), false);
+ Shell::GetInstance()
+ ->partial_magnification_controller()
+ ->SwitchTargetRootWindow(ash_host->AsWindowTreeHost()->window());
+
if (primary_tree_host_for_replace_) {
AshWindowTreeHost* to_delete = primary_tree_host_for_replace_;
primary_tree_host_for_replace_ = nullptr;
« no previous file with comments | « no previous file | ash/display/display_manager.h » ('j') | ash/host/ash_remote_window_tree_host_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698