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

Unified Diff: ash/display/display_controller.cc

Issue 17099003: Use primary display as hangout/gtalk broadcast window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_controller.h ('k') | ash/display/display_controller_unittest.cc » ('j') | no next file with comments »
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 bc1aeff7084338c7a1d0ccc5456ef37e7e1095a2..07542862a69a364545dc3eefea630c5673523960 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -461,6 +461,7 @@ void DisplayController::InitSecondaryDisplays() {
layout.primary_id == gfx::Display::kInvalidDisplayID ?
pair.first : layout.primary_id);
}
+ UpdateHostWindowNames();
}
void DisplayController::AddObserver(Observer* observer) {
@@ -1017,6 +1018,7 @@ void DisplayController::NotifyDisplayConfigurationChanged() {
}
}
FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanged());
+ UpdateHostWindowNames();
}
void DisplayController::RegisterLayoutForDisplayIdPairInternal(
@@ -1036,4 +1038,20 @@ void DisplayController::OnFadeOutForSwapDisplayFinished() {
#endif
}
+void DisplayController::UpdateHostWindowNames() {
+#if defined(USE_X11)
+ // crbug.com/120229 - set the window title for the primary dislpay
+ // to "aura_root_0" so gtalk can find the primary root window to broadcast.
+ // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting.
+ aura::RootWindow* primary = Shell::GetPrimaryRootWindow();
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ for (size_t i = 0; i < root_windows.size(); ++i) {
+ std::string name =
+ root_windows[i] == primary ? "aura_root_0" : "aura_root_x";
+ gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget();
+ XStoreName(ui::GetXDisplay(), xwindow, name.c_str());
+ }
+#endif
+}
+
} // namespace ash
« no previous file with comments | « ash/display/display_controller.h ('k') | ash/display/display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698