Commit 7566f8d3 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Change the timing of Hide and losing Focus in Mash

This CL changes the order of HideImpl and giving up the focus
within DesktopWindowTreeHostMus. As is written in the comment,
this is because some code like WindowActivityWatcher assumes
the window is already invisible when the window gives up the
focus.

BUG=896080
TEST=interactive_ui_tests --enable-features=SingleProcessMash

Change-Id: I48a45bbea87c2e66d9827d2f7776b038edfca512
Reviewed-on: https://chromium-review.googlesource.com/c/1297401Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602245}
parent 4970db68
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
# misc. # misc.
-DevToolsManagerDelegateTest.ShowMinimizedWindow -DevToolsManagerDelegateTest.ShowMinimizedWindow
-WindowActivityWatcherTest.Basic
-WindowActivityWatcherTest.MultipleWindows
-WindowActivityWatcherTest.WindowActivation
# Broken tests related to accessibility. crbug.com/888750 and crbug.com/889093 # Broken tests related to accessibility. crbug.com/888750 and crbug.com/889093
-GuestSpokenFeedbackTest.FocusToolbar -GuestSpokenFeedbackTest.FocusToolbar
......
...@@ -903,19 +903,22 @@ void DesktopWindowTreeHostMus::ShowImpl() { ...@@ -903,19 +903,22 @@ void DesktopWindowTreeHostMus::ShowImpl() {
} }
void DesktopWindowTreeHostMus::HideImpl() { void DesktopWindowTreeHostMus::HideImpl() {
native_widget_delegate_->OnNativeWidgetVisibilityChanging(false);
WindowTreeHostMus::HideImpl();
native_widget_delegate_->OnNativeWidgetVisibilityChanged(false);
// When hiding we can't possibly be active any more. Reset the FocusClient, // When hiding we can't possibly be active any more. Reset the FocusClient,
// which effectively triggers giving up focus (and activation). Mus will // which effectively triggers giving up focus (and activation). Mus will
// eventually generate a focus event, but that's async. // eventually generate a focus event, but that's async. This should be done
// after the window gets hidden actually, since some code (like
// WindowActivityWatcher) assumes closing window is already invisible when the
// focus is lost. See https://crbug.com/896080.
if (IsFocusClientInstalledOnFocusSynchronizer()) { if (IsFocusClientInstalledOnFocusSynchronizer()) {
MusClient::Get() MusClient::Get()
->window_tree_client() ->window_tree_client()
->focus_synchronizer() ->focus_synchronizer()
->SetActiveFocusClient(nullptr, nullptr); ->SetActiveFocusClient(nullptr, nullptr);
} }
native_widget_delegate_->OnNativeWidgetVisibilityChanging(false);
WindowTreeHostMus::HideImpl();
native_widget_delegate_->OnNativeWidgetVisibilityChanged(false);
} }
void DesktopWindowTreeHostMus::SetBoundsInPixels( void DesktopWindowTreeHostMus::SetBoundsInPixels(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment