New issue
Advanced search Search tips

Issue 902598 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Mash toplevel windows can't be focused when minimized

Project Member Reported by mukai@chromium.org, Nov 7

Issue description

TabDragging/DetachToBrowserTabDragControllerTestTouch.PressSecondFingerWhileDetached/0 is still failing. It fails at https://cs.chromium.org/chromium/src/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc?sq=package:chromium&g=0&l=2576, which means the dragged window isn't active after the drag ends.

Actually, this test case minimizes the dragged window as for the gesture created through the test input; it falls into https://cs.chromium.org/chromium/src/ash/wm/workspace/workspace_window_resizer.cc?sq=package:chromium&g=0&l=594. However the dragged window gets activated as the result of TabDragController::RestoreFocus (https://cs.chromium.org/chromium/src/chrome/browser/ui/views/tabs/tab_drag_controller.cc?sq=package:chromium&g=0&l=1433).

The same code path runs even when SingleProcessMash is enabled, however the window doesn't get activated even Focus() is called.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c38f7d2d476197d73bd79b607c2c51f2f561a50e

commit c38f7d2d476197d73bd79b607c2c51f2f561a50e
Author: Jun Mukai <mukai@chromium.org>
Date: Wed Nov 07 21:42:11 2018

Allow Focus when the window is minimized

TabDragging's PressSecondFingerWhileDetached/0 is still failing,
and this fails due to a corner case of focus and visibility
handling in the window system;
- the test scenario falls into a certain gesture, which will
  minimize the dragged window
  https://cs.chromium.org/chromium/src/ash/wm/workspace/workspace_window_resizer.cc?g=0&l=594
- TabDragController restores focus at the end of dragging
  https://cs.chromium.org/chromium/src/chrome/browser/ui/views/tabs/tab_drag_controller.cc?g=0&l=1433

On the classic environment, this shows the dragged window and
re-activates it, while it fails to activate on Mash, and so
it fails at
https://cs.chromium.org/chromium/src/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc?sq=package:chromium&g=0&l=2576

This CL allows focus directly on the minimized window;
- DesktopWindowTreeHostMus shouldn't early-return if the window
  is invisible because of minimized status
- DesktopFocusRules should check the minimized status too, otherwise
  FocusController can't find the focusable / activatable windows
- TestWindowService should take care of synchronizing the window's
  show state and its visibility. The DesktopWindowTreeHostMusTest's
  case is changing the window state but not changing the visibility.
- sometimes a window is created with minimized status.
  DesktopWindowTreeHostMus::Show() needs to take care of such situation,
  otherwise it isn't starting with minimized status.

BUG= 902598 
TEST=the edited test case and unfiltered test case

Change-Id: Icae808806ba134a3789b39438179818011379064
Reviewed-on: https://chromium-review.googlesource.com/c/1321859
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606175}
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/services/ws/test_ws/test_window_service.cc
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/services/ws/test_ws/test_window_service.h
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/testing/buildbot/filters/chromeos.single_process_mash.interactive_ui_tests.filter
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/ui/views/mus/desktop_window_tree_host_mus.cc
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/ui/views/widget/desktop_aura/desktop_focus_rules.cc
[modify] https://crrev.com/c38f7d2d476197d73bd79b607c2c51f2f561a50e/ui/views/widget/desktop_aura/desktop_focus_rules.h

Status: Fixed (was: Started)

Sign in to add a comment