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

Unified Diff: components/mus/ws/window_tree.cc

Issue 2019013002: mus: Send display-id to client only for the root windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: doc Created 4 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 | « components/mus/ws/test_utils.cc ('k') | components/mus/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index f00cfc72fb3a17832a217d92cb382ec0a3157b39..0e3889bd4349d803b9838bc4d10f891c01b5dba5 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -103,6 +103,8 @@ void WindowTree::Init(std::unique_ptr<WindowTreeBinding> binding,
GetUnknownWindowsFrom(root, &to_send);
Display* display = GetDisplay(root);
+ int64_t display_id =
+ display ? display->id() : display::Display::kInvalidDisplayID;
const ServerWindow* focused_window =
display ? display->GetFocusedWindow() : nullptr;
if (focused_window)
@@ -113,7 +115,7 @@ void WindowTree::Init(std::unique_ptr<WindowTreeBinding> binding,
const bool drawn = root->parent() && root->parent()->IsDrawn();
client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree),
- focused_window_id.id, drawn);
+ display_id, focused_window_id.id, drawn);
}
void WindowTree::ConfigureWindowManager() {
@@ -375,9 +377,12 @@ void WindowTree::OnWindowManagerCreatedTopLevelWindow(
window_id_to_client_id_map_[window->id()] =
waiting_for_top_level_window_info->client_window_id;
roots_.insert(window);
+ Display* display = GetDisplay(window);
+ int64_t display_id =
+ display ? display->id() : display::Display::kInvalidDisplayID;
const bool drawn = window->parent() && window->parent()->IsDrawn();
client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window),
- drawn);
+ display_id, drawn);
}
void WindowTree::AddActivationParent(const ClientWindowId& window_id) {
@@ -851,15 +856,6 @@ mojom::WindowDataPtr WindowTree::WindowToWindowData(
const ServerWindow* window) {
DCHECK(IsWindowKnown(window));
const ServerWindow* parent = window->parent();
-
- // Get the associated display before |parent| may be reset.
- int64_t display_id = display::Display::kInvalidDisplayID;
- const Display* display = display_manager()->GetDisplayContaining(window);
- if (!display && parent)
- display = display_manager()->GetDisplayContaining(parent);
- if (display)
- display_id = display->id();
-
// If the parent isn't known, it means the parent is not visible to us (not
// in roots), and should not be sent over.
if (parent && !IsWindowKnown(parent))
@@ -873,7 +869,6 @@ mojom::WindowDataPtr WindowTree::WindowToWindowData(
window_data->properties =
mojo::Map<String, Array<uint8_t>>::From(window->properties());
window_data->visible = window->visible();
- window_data->display_id = display_id;
return window_data;
}
« no previous file with comments | « components/mus/ws/test_utils.cc ('k') | components/mus/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698