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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2582523003: Fixes visibility bugs in DesktopWindowTreeHostMus (Closed)
Patch Set: Created 4 years 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 | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/desktop_window_tree_host_mus.cc
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc
index 4b280c4dc25ec8ef3c380d4a675ee3058fdbdb7c..12c9e7fd24c77fe6970f50b2b14516c6849938a4 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -293,6 +293,10 @@ void DesktopWindowTreeHostMus::Close() {
if (close_widget_factory_.HasWeakPtrs())
return;
+ // Even though we don't close immediately, we need to hide immediately
+ // (otherwise events may be processed, which is unexpected).
+ Hide();
+
// Close doesn't delete this immediately, as 'this' may still be on the stack
// resulting in possible crashes when the stack unwindes.
base::ThreadTaskRunnerHandle::Get()->PostTask(
@@ -332,6 +336,8 @@ void DesktopWindowTreeHostMus::ShowWindowWithState(ui::WindowShowState state) {
if (compositor())
compositor()->SetVisible(true);
+ native_widget_delegate_->OnNativeWidgetVisibilityChanged(true);
+
if (native_widget_delegate_->CanActivate()) {
if (state != ui::SHOW_STATE_INACTIVE)
Activate();
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698