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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.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
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index 77a86e1604028cbc58cb1a7c0e9720add1373cd0..763d0abc02bc09cf6aa6bfdce7607efcec828a90 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -50,7 +50,6 @@ Window* AddWindowToClient(WindowTreeClientImpl* client,
private_window.set_connection(client);
private_window.set_server_id(window_data->window_id);
private_window.set_visible(window_data->visible);
- private_window.LocalSetDisplay(window_data->display_id);
private_window.set_properties(
window_data->properties
.To<std::map<std::string, std::vector<uint8_t>>>());
@@ -546,6 +545,7 @@ Window* WindowTreeClientImpl::NewWindowImpl(
void WindowTreeClientImpl::OnEmbedImpl(mojom::WindowTree* window_tree,
ClientSpecificId client_id,
mojom::WindowDataPtr root_data,
+ int64_t display_id,
Id focused_window_id,
bool drawn) {
// WARNING: this is only called if WindowTreeClientImpl was created as the
@@ -555,6 +555,7 @@ void WindowTreeClientImpl::OnEmbedImpl(mojom::WindowTree* window_tree,
DCHECK(roots_.empty());
Window* root = AddWindowToClient(this, nullptr, root_data);
+ WindowPrivate(root).LocalSetDisplay(display_id);
roots_.insert(root);
focused_window_ = GetWindowByServerId(focused_window_id);
@@ -658,6 +659,7 @@ void WindowTreeClientImpl::RemoveObserver(
void WindowTreeClientImpl::OnEmbed(ClientSpecificId client_id,
mojom::WindowDataPtr root_data,
mojom::WindowTreePtr tree,
+ int64_t display_id,
Id focused_window_id,
bool drawn) {
DCHECK(!tree_ptr_);
@@ -669,7 +671,7 @@ void WindowTreeClientImpl::OnEmbed(ClientSpecificId client_id,
tree_ptr_.associated_group()));
}
- OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data),
+ OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data), display_id,
focused_window_id, drawn);
}
@@ -704,6 +706,7 @@ void WindowTreeClientImpl::OnLostCapture(Id window_id) {
void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id,
mojom::WindowDataPtr data,
+ int64_t display_id,
bool drawn) {
// The server ack'd the top level window we created and supplied the state
// of the window at the time the server created it. For properties we do not
@@ -725,7 +728,7 @@ void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id,
// Drawn state and display-id always come from the server (they can't be
// modified locally).
window_private.LocalSetParentDrawn(drawn);
- window_private.LocalSetDisplay(data->display_id);
+ window_private.LocalSetDisplay(display_id);
// The default visibilty is false, we only need update visibility if it
// differs from that.

Powered by Google App Engine
This is Rietveld 408576698