Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce OnWindowVisibilityChanging() hook in exo::ExtendedDragSource
It turns out that exo::ExtendedDragSource class can benefit from overriding both OnWindowVisibilityChanging() and OnWindowVisibilityChanged() hooks. In [1], the use of OnWindowVisibilityChanging() hook was changed by OnWindowVisibilityChanged(), since according to the existing Ash's drag'n drop logic, by the time ash::ToplevelWindowEventHandler::AttemptToStartDrag() is called the window state should be up to date, something that occurs in ash::TabletModeWindowManager::OnWindowVisibilityChanged(). However, it turns how that Lacros needs to set ash::kIsDraggingTabsKey property as soon as possible, so that undesirable window resizes don't take place during the drag'n drop beginning - causing the window to flicker. This CL reintroduces OnWindowVisibilityChanging() hook, and moves some of the logic in OnWindowVisibilityChanged() into it, In practice, it avoids Lacros from flicking when starting a drag'n drop (see stack trace below) [1] https://crrev.com/c/3254858 #9 0x7f8f4dda154a ash::TabletModeWindowState::UpdateBounds() <-- calls aura::Window::SetBounds() #10 0x7f8f4dda0e0e ash::TabletModeWindowState::UpdateWindow() #11 0x7f8f4dda16ef ash::TabletModeWindowState::AttachState() #12 0x7f8f4ddcd304 ash::WindowState::SetStateObject() #13 0x7f8f4dda03b1 ash::TabletModeWindowState::TabletModeWindowState() #14 0x7f8f4dd98830 ash::TabletModeWindowManager::TrackWindow() #15 0x7f8f4dd995a7 ash::TabletModeWindowManager::OnWindowVisibilityChanged() #16 0x7f8f4ff664fc aura::Window::NotifyWindowVisibilityChangedAtReceiver() #17 0x7f8f4ff661c6 aura::Window::NotifyWindowVisibilityChangedDown() #18 0x7f8f4ff652d7 aura::Window::NotifyWindowVisibilityChanged() #19 0x7f8f4ff6002a aura::Window::SetVisibleInternal() #20 0x7f8f4ff5fcaa aura::Window::Show() #21 0x7f8f4f371b3b views::NativeWidgetAura::Show() #22 0x7f8f4f3260b8 views::Widget::Show() #23 0x55d01acb6fd6 exo::ShellSurfaceBase::CommitWidget() #24 0x55d01acb6b78 exo::ShellSurfaceBase::OnSurfaceCommit() #25 0x55d01ac7d90d exo::Surface::Commit() (..) BUG=1252941 R=oshima@chromium.org Change-Id: Ib6ba73d3bb2a90a3ac180c974f292bec39c1b3d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3365554 Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> Cr-Commit-Position: refs/heads/main@{#955327}
- Loading branch information