Commit e4a6e8a2 authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

Fix web contents layout issues during tab dragging sessions

Fast resize mode is set for web contents view every time tab dragging
status changes for both window source and dragged browser window. Which
was originally introduced as a performance optimization targeting
ChromeOS' tablet mode, where both windows bounds change during the
dragging session.

This causes issues such as crbug.com/1114767, where the source window
does not get correctly relaid out after a tab is dragged out of it into
a new browser window, particularly when that tab dragging session
started after a window resize or state change (eg: normal -> maximized).

That said, this patch fixes it by not setting "fast resize" on Linux
desktop builds. Where subtle bugs may happen, eg: tiling WMs not
honoring bounds requested, etc.

R=sky@chromium.org

Bug: 1114767
Change-Id: Ic33fd2471fe6ddbb05af650e724106c6600319d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346795Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#799640}
parent fb4c4beb
......@@ -1476,6 +1476,9 @@ void BrowserView::ToolbarSizeChanged(bool is_animating) {
}
void BrowserView::TabDraggingStatusChanged(bool is_dragging) {
// TODO(crbug.com/1110266): Remove explicit OS_CHROMEOS check once OS_LINUX
// CrOS cleanup is done.
#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
contents_web_view_->SetFastResize(is_dragging);
if (!is_dragging) {
// When tab dragging is ended, we need to make sure the web contents get
......@@ -1484,6 +1487,7 @@ void BrowserView::TabDraggingStatusChanged(bool is_dragging) {
contents_web_view_->InvalidateLayout();
contents_container_->Layout();
}
#endif
}
void BrowserView::FocusBookmarksToolbar() {
......
......@@ -3290,11 +3290,15 @@ void FastResizeDuringDraggingStep2(DetachToBrowserTabDragControllerTest* test,
// the dragged tab.
EXPECT_EQ(3u, test->browser_list->size());
// TODO(crbug.com/1110266): Remove explicit OS_CHROMEOS check once OS_LINUX
// CrOS cleanup is done.
#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
// Get this new created window for the drag. It should have fast resize set.
Browser* new_browser = test->browser_list->get(2);
EXPECT_TRUE(WebContentsIsFastResized(new_browser));
// The source window should also have fast resize set.
EXPECT_TRUE(WebContentsIsFastResized(test->browser()));
#endif
// Now drag to target_tab_strip.
ASSERT_TRUE(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment