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

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

Issue 1864113002: Fixes problems with drawn state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: parentdrawn and merge Created 4 years, 8 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 b582d854055131119d0bebafb2dbbce48f170933..61a37d051fdc306b885164d4e63f673b8db68079 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -94,9 +94,10 @@ void WindowTree::Init(scoped_ptr<WindowTreeBinding> binding,
std::vector<const ServerWindow*> to_send;
CHECK_EQ(1u, roots_.size());
- GetUnknownWindowsFrom(*roots_.begin(), &to_send);
+ const ServerWindow* root = *roots_.begin();
+ GetUnknownWindowsFrom(root, &to_send);
- Display* display = GetDisplay(*roots_.begin());
+ Display* display = GetDisplay(root);
const ServerWindow* focused_window =
display ? display->GetFocusedWindow() : nullptr;
if (focused_window)
@@ -105,8 +106,9 @@ void WindowTree::Init(scoped_ptr<WindowTreeBinding> binding,
if (focused_window)
IsWindowKnown(focused_window, &focused_window_id);
+ const bool drawn = root->parent() && root->parent()->IsDrawn();
client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree),
- focused_window_id.id);
+ focused_window_id.id, drawn);
}
void WindowTree::ConfigureWindowManager() {
@@ -340,7 +342,9 @@ void WindowTree::OnWindowManagerCreatedTopLevelWindow(
window_id_to_client_id_map_[window->id()] =
waiting_for_top_level_window_info->client_window_id;
roots_.insert(window);
- client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window));
+ const bool drawn = window->parent() && window->parent()->IsDrawn();
+ client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window),
+ drawn);
}
void WindowTree::OnChangeCompleted(uint32_t change_id, bool success) {
@@ -817,7 +821,6 @@ mojom::WindowDataPtr WindowTree::WindowToWindowData(
window_data->properties =
mojo::Map<String, Array<uint8_t>>::From(window->properties());
window_data->visible = window->visible();
- window_data->drawn = window->IsDrawn();
window_data->viewport_metrics =
window_server_->GetViewportMetricsForWindow(window);
return window_data;
@@ -850,8 +853,8 @@ void WindowTree::NotifyDrawnStateChanged(const ServerWindow* window,
for (auto* root : roots_) {
if (window->Contains(root) && (new_drawn_value != root->IsDrawn())) {
- client()->OnWindowDrawnStateChanged(ClientWindowIdForWindow(root).id,
- new_drawn_value);
+ client()->OnWindowParentDrawnStateChanged(
+ ClientWindowIdForWindow(root).id, new_drawn_value);
}
}
}
« 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