New issue
Advanced search Search tips

Issue 882654 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

mash: "Restore pages?" dialog can be wrongly positioned on overview mode / tablet mode

Project Member Reported by mukai@chromium.org, Sep 10

Issue description

1. make a crash on browser process (manually sending kill -KILL)
2. boot the browser with --enable-features=Mash or --enable-features=SingleProcessMash
3. enter into the tablet mode (ctrl-shift-alt-t with --ash-debug-shortcuts flag)
4. drag from a browser tab in the window
5. drop somewhere

expected: the 'Restore pages?' popup is correctly positioned relative to the browser window.

actual: the popup position is wrong, see the attached file.

notes:
- no problem without Mash
- no problem when window dragging (dragging from window frame)
 
forgotten to attach the image: 
Screenshot 2018-09-10 at 13.54.26.png
115 KB View Download
This is due to asynchronous updates of bounds; some transformer may refer to an intermediate bounds.
- this popup is a bubble view, a transient child of the browser window
- ash::SetTransform() in ash/overview/overview_util.h applies the scaling on the browser and its transient descendants
- when the user finishes tab-dragging, Ash resizes the window back to the original size, and then invokes this to scale.

in classic environment, this works as the following flow:
- ash::WindowGrid::AddDraggedWindowIntoOverviewOnDragEnd() invokes TabletModeWindowState::UpdateWindowPosition() to resize the browser window bounds to the original
- the bubble watches the bounds change and resize itself (see views::BubbleDialogDelegateView::OnWidgetBoundsChanged) 
- then ash::SetTransform() to apply the transform to both the browser and the bubble

in Mash / SingleProcessMash:
- WindowGrid invokes the same code. This causes to propagate the new bounds to the browser
- then ash::SetTransform() to apply the transform. The browser window is scaled properly (since its new bounds is known to Ash), yet the bubble still keeps the old bounds.
- the bounds change is propagated to mojo, views::WidgetDialogDelegateView can update to the new position


So Mash invokes ash::SetTransform too earlier than expected -- it should wait for the bounds update of all transient children -- but this happens in browser, it's not known quite well when it ends.
Cc: mustash-bugs@google.com

Sign in to add a comment