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

Unified Diff: ash/display/window_tree_host_manager.cc

Issue 2627933003: Bug Fix: ChromeOS Screen Name Mismatch (Closed)
Patch Set: Format Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/window_tree_host_manager.cc
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc
index c430d91e9ad2868e7ecd04d1cb86758ad433203d..530636bd0de22dcc18c8a2388450c9e43db1bc1f 100644
--- a/ash/display/window_tree_host_manager.cc
+++ b/ash/display/window_tree_host_manager.cc
@@ -445,14 +445,19 @@ void WindowTreeHostManager::SetPrimaryDisplayId(int64_t id) {
CHECK(primary_host);
CHECK_NE(primary_host, non_primary_host);
+ aura::Window* primary_window = GetWindow(primary_host);
+ aura::Window* non_primary_window = GetWindow(non_primary_host);
window_tree_hosts_[new_primary_display.id()] = primary_host;
- GetRootWindowSettings(GetWindow(primary_host))->display_id =
- new_primary_display.id();
+ GetRootWindowSettings(primary_window)->display_id = new_primary_display.id();
window_tree_hosts_[old_primary_display.id()] = non_primary_host;
- GetRootWindowSettings(GetWindow(non_primary_host))->display_id =
+ GetRootWindowSettings(non_primary_window)->display_id =
old_primary_display.id();
+ base::string16 old_primary_title = primary_window->GetTitle();
+ primary_window->SetTitle(non_primary_window->GetTitle());
+ non_primary_window->SetTitle(old_primary_title);
+
const display::DisplayLayout& layout =
GetDisplayManager()->GetCurrentDisplayLayout();
// The requested primary id can be same as one in the stored layout
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698