forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the aura::WindowObserver hook used in exo::ExtendedDragSource
This CL changes the aura::WindowObserver hook used in exo::ExtendedDragSource: Previously, ExtendedDragSource::OnWindowVisibilityChanging() was used to call ash::ToplevelWindowEventHandler::AttemptToStartDrag(), and kick off the drag 'n drop. Problem is that for the scenario of TabletMode ON and WebUITabStrip OFF, using OnWindowVisibilityChanging() hook is too early. Reason: In today's ToT, when a window detaches, during a tab drag 'n drop, the following check takes place and fails, causing the whole operation to abort (see lines 309-310 below): 295 std::unique_ptr<WindowResizer> CreateWindowResizerForTabletMode( 296 aura::Window* window, ...) { (...) 306 WindowState* window_state = WindowState::Get(window); 307 // Only maximized/fullscreen/snapped window can be dragged from 308 // the top of the screen. 309 if (!window_state->IsMaximized() && !window_state->IsFullscreen() 310 && !window_state->IsSnapped()) { 311 return nullptr; This happens because the |window_state| in case is only set to MAXIMIZED from a code that uses OnWindowVisibilityChanged() hook: (...) #12 0x7fe849164dda TabletModeWindowManager::OnWindowVisibilityChanged() (...) #15 0x7fe8520d2be3 aura::Window::NotifyWindowVisibilityChanged() #16 0x7fe8520cdf2c aura::Window::SetVisibleInternal() #17 0x7fe8520cdc54 aura::Window::Show() #18 0x7fe84cfcf013 views::NativeWidgetAura::Show() #19 0x7fe84cf89398 views::Widget::Show() #20 0x561eee1cb154 exo::ShellSurfaceBase::CommitWidget() #21 0x561eee1cacf6 exo::ShellSurfaceBase::OnSurfaceCommit() Hence, using OnDraggedWindowVisibilityChanging() in exo::ExtendedDragSource class is too early. This CL changes the hook used to OnWindowVisibilityChanged(), and also sets the following aura::Window properties, used by the drag 'n drop logic: ash::kTabDraggingSourceWindowKey and ash::kIsDraggingTabsKey. With this change, the functionality starts to take shape, and it is possible to drag the window around. Snapping and merge-back are still not fully functional (see follow up CLs). R=oshima@chromium.org BUG=1252941 Change-Id: I8600652a974210e3081e97d6d65639582ad222ad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3254858 Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> Cr-Commit-Position: refs/heads/main@{#939226}
- Loading branch information
Showing
3 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters