Skip to content

Commit

Permalink
tablet_mode: Fix crash on dragging split divider at tablet mode
Browse files Browse the repository at this point in the history
This CL fixed the crash when quickly dragging the split bar at tablet
mode with multiple displays by setting the property kLockedToRootKey to
true for the native window of the split bar. By doing this, we can make
sure that the split divider will always stay at the the display where it's created.

Fixed: 1316960
Test: manual
Change-Id: Ic94c2c90a3ab69de4f894b241f6ef0dacf9d13a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3716823
Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
Commit-Queue: Connie Xu <conniekxu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017822}
  • Loading branch information
conniekxu authored and Chromium LUCI CQ committed Jun 24, 2022
1 parent e7b913a commit 4d0d4d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ash/wm/splitview/split_view_divider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "ash/wm/splitview/split_view_divider_handler_view.h"
#include "ash/wm/splitview/split_view_utils.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
#include "base/containers/contains.h"
#include "base/task/sequenced_task_runner.h"
Expand Down Expand Up @@ -494,6 +495,7 @@ void SplitViewDivider::CreateDividerWidget(SplitViewController* controller) {
divider_view_ = divider_widget_->SetContentsView(
std::make_unique<DividerView>(controller, this));
divider_widget_->SetBounds(GetDividerBoundsInScreen(false /* is_dragging */));
divider_widget_->GetNativeWindow()->SetProperty(kLockedToRootKey, true);
divider_widget_->Show();
}

Expand Down

0 comments on commit 4d0d4d2

Please sign in to comment.