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

Unified Diff: components/exo/shell_surface.cc

Issue 2743053002: arc: Fix race condition in applying modal state. (Closed)
Patch Set: forgotten nit Created 3 years, 9 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/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 00a36dafe34afe065a4edb1d2dce8b858e4dc83e..8b61a9d121e7169dea7f1cf3e1f7be42053fc4b9 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -496,9 +496,22 @@ void ShellSurface::SetSystemModal(bool system_modal) {
<< "Only a window in SystemModalContainer can change the modality";
return;
}
+
+ if (system_modal == system_modal_)
+ return;
+
+ system_modal_ = system_modal;
+
+ if (widget_)
+ UpdateSystemModal();
+}
+
+void ShellSurface::UpdateSystemModal() {
+ DCHECK(widget_);
+ DCHECK_EQ(container_, ash::kShellWindowId_SystemModalContainer);
widget_->GetNativeWindow()->SetProperty(
aura::client::kModalKey,
- system_modal ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE);
+ system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE);
}
// static
@@ -766,6 +779,8 @@ void ShellSurface::OnSurfaceCommit() {
DCHECK(!widget_->IsVisible());
pending_show_widget_ = false;
widget_->Show();
+ if (container_ == ash::kShellWindowId_SystemModalContainer)
+ UpdateSystemModal();
}
}
}
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698