Index: components/exo/shell_surface.cc |
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc |
index 6248a27c13212c96588327d4db216d9844e79d12..0181bf1bba2303004d059741240a87ddb00a8c99 100644 |
--- a/components/exo/shell_surface.cc |
+++ b/components/exo/shell_surface.cc |
@@ -253,6 +253,7 @@ ShellSurface::ScopedAnimationsDisabled::~ScopedAnimationsDisabled() { |
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(std::string*, kApplicationIdKey, nullptr) |
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr) |
+DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kShelfWindowReady, false) |
ShellSurface::ShellSurface(Surface* surface, |
ShellSurface* parent, |
@@ -463,6 +464,16 @@ const std::string ShellSurface::GetApplicationId(aura::Window* window) { |
return string_ptr ? *string_ptr : std::string(); |
} |
+// static |
+bool ShellSurface::IsApplicationWindowReadyPropertyKey(const void* key) { |
+ return kShelfWindowReady == key; |
+} |
+ |
+// static |
+bool ShellSurface::IsApplicationWindowReadyToShow(aura::Window* window) { |
+ return window->GetProperty(kShelfWindowReady); |
+} |
+ |
void ShellSurface::SetApplicationId(const std::string& application_id) { |
TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id", |
application_id); |
@@ -622,8 +633,9 @@ void ShellSurface::OnSurfaceCommit() { |
if (pending_show_widget_) { |
DCHECK(!widget_->IsClosed()); |
DCHECK(!widget_->IsVisible()); |
+ DCHECK(!widget_->GetNativeWindow()); |
pending_show_widget_ = false; |
- widget_->Show(); |
+ widget_->GetNativeWindow()->SetProperty(kShelfWindowReady, true); |
} |
} |
} |