Commit 48e70bb9 authored by David Black's avatar David Black Committed by Commit Bot

Don't dismiss Assistant when using virtual keyboard.

Assistant UI is hidden when tapping outside of the widget. We should
also check if the user is interacting with the virtual keyboard to avoid
closing Assistant UI while the user is typing.

Bug: b:117833352
Change-Id: I95437c4bd495321cf41c8add6d4ab283b771a442
Reviewed-on: https://chromium-review.googlesource.com/c/1287262Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#600947}
parent e688c971
......@@ -418,12 +418,18 @@ void AssistantUiController::OnEvent(const ui::Event& event) {
const gfx::Rect screen_bounds =
container_view_->GetWidget()->GetWindowBoundsInScreen();
const gfx::Rect keyboard_bounds =
keyboard::KeyboardController::Get()->GetWorkspaceOccludedBounds();
// Pressed events outside our widget bounds should result in hiding of
// Assistant UI. This event does not fire during a Metalayer session so we
// needn't enforce logic to prevent hiding when using the stylus.
if (!screen_bounds.Contains(screen_location))
// Pressed events outside our widget bounds should result in hiding of the
// Assistant UI. The exception to this rule is if the user is interacting
// with the virtual keyboard in which case we should not dismiss Assistant UI.
// Note that this event does not fire during a Metalayer session so we needn't
// enforce logic to prevent hiding when using the stylus.
if (!screen_bounds.Contains(screen_location) &&
!keyboard_bounds.Contains(screen_location)) {
HideUi(AssistantSource::kUnspecified);
}
}
void AssistantUiController::UpdateUsableWorkArea(aura::Window* root_window) {
......
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