DescriptionMacViews: Suppress visibility changes during an asynchronous close.
Currently, MD buttons with ripple effects receive a visibility change
while a Widget is closing. InkDropHostView::VisibilityChanged(..) has
logic that begins a Layer animation when visibility becomes false.
Since it's during Widget::Close(), this tickles a codepath when adding
the layer to the Button that also attempts to create the parent layer
backing the entire widget (which just got cleared out due to the close
request). NativeWidgetMac doesn't like this - it only has logic
implemented to sync up the Widget's backing layer with the compositor
once, and DCHECKs if something tries to do it again.
Views generally shouldn't be doing much if their Widget is closing, so
fix this by suppressing the Widget visibility change notifications
during Widget closure in NativeWidgetMac. Add a test for this.
Currently the test reveals that both Windows and Linux still send out
visibility change notifications during Widget::Close().
== Open questions ==
- Is InkDropHostView::VisibilityChanged(..) also trying to start
animations during closure on Windows/Linux
- If so, is it causing bad stuff (but not bad enough to crash/dcheck)?
- Is suppressing visibility changes during Widget::Close the right thing
to do? (e.g. do we lose a valid use-case doing this, or just get the
benefit of less noise/cycles during Widget Close).
- Do we need to clear out the layer during Close() at all? (If we don't
there are lifetime issues in WidgetCaptureTest.DestroyWithCapture_Close,
but they may be able to be fixed)
BUG=619798
Patch Set 1 #Patch Set 2 : Just simplify ::Close() #Patch Set 3 : Add a test, try it out on other platforms #Patch Set 4 : Move things to BridgedNativeWidget #Patch Set 5 : rebase #Patch Set 6 : fixes #Patch Set 7 : Neater, but Linux, Windows disagree on WidgetTest.DesktopNativeWidgetVisibilityAfterCloseTest #
Messages
Total messages: 14 (14 generated)
|