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

Unified Diff: mojo/services/view_manager/connection_manager.cc

Issue 745743002: Makes views be initially hidden (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: feedback Created 6 years, 1 month 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 | « mojo/services/public/cpp/view_manager/view.h ('k') | mojo/services/view_manager/server_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/connection_manager.cc
diff --git a/mojo/services/view_manager/connection_manager.cc b/mojo/services/view_manager/connection_manager.cc
index f0b608db306168bc5f524d7d48298678c2a62ce3..4e69b14d01b6af2f3453ed93866cfc7abc085d3d 100644
--- a/mojo/services/view_manager/connection_manager.cc
+++ b/mojo/services/view_manager/connection_manager.cc
@@ -120,6 +120,7 @@ ConnectionManager::ConnectionManager(ConnectionManagerDelegate* delegate,
current_change_(nullptr),
in_destructor_(false) {
root_->SetBounds(gfx::Rect(800, 600));
+ root_->SetVisible(true);
display_manager_->Init(this);
}
@@ -384,6 +385,13 @@ void ConnectionManager::OnWillChangeViewVisibility(ServerView* view) {
if (in_destructor_)
return;
+ // Need to repaint if the view was drawn (which means it'll in the process of
+ // hiding) or the view is transitioning to drawn.
+ if (view->IsDrawn(root_.get()) || (!view->visible() && view->parent() &&
+ view->parent()->IsDrawn(root_.get()))) {
+ display_manager_->SchedulePaint(view->parent(), view->bounds());
+ }
+
if (view != root_.get() && view->id() != ClonedViewId() &&
root_->Contains(view) && view->IsDrawn(root_.get())) {
// We're about to hide |view|, this would implicitly make any cloned views
« no previous file with comments | « mojo/services/public/cpp/view_manager/view.h ('k') | mojo/services/view_manager/server_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698