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(); |