Skip to content

Commit

Permalink
Don't use kAdjustmentSlideY for toplevel context menus
Browse files Browse the repository at this point in the history
In certain edge cases, such as on Ozone/Wayland where the context menu
size is larger than half of usable screen area's height, this might
cause the mouse pointer to be inside the context menu. This would likely
cause the user to inadvertently click on a context menu item.

Bug: 1348713
Change-Id: I4b790c27bab23b2015e2ea2b498ffc666560530b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3790917
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035012}
  • Loading branch information
Phan Quang Minh authored and Chromium LUCI CQ committed Aug 15, 2022
1 parent 59039be commit a086ad0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,7 @@ Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Peter Snyder <snyderp@gmail.com>
Peter Varga <pvarga@inf.u-szeged.hu>
Peter Wong <peter.wm.wong@gmail.com>
Phan Quang Minh <phanquangminh217@gmail.com>
Philip Hanson <philip.hanson@intel.com>
Philipp Hancke <fippo@andyet.net>
Philipp Hancke <philipp.hancke@googlemail.com>
Expand Down
1 change: 0 additions & 1 deletion ui/views/controls/menu/menu_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,6 @@ void MenuController::SetAnchorParametersForItem(MenuItemView* item,
anchor->anchor_gravity = ui::OwnedWindowAnchorGravity::kBottomRight;
anchor->constraint_adjustment =
ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideX |
ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideY |
ui::OwnedWindowConstraintAdjustment::kAdjustmentFlipY |
ui::OwnedWindowConstraintAdjustment::kAdjustmentRezizeY;
} else {
Expand Down
1 change: 0 additions & 1 deletion ui/views/controls/menu/menu_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2827,7 +2827,6 @@ TEST_F(MenuControllerTest, ContextMenuInitializesAuraWindowWhenShown) {
anchor->anchor_position);
EXPECT_EQ(ui::OwnedWindowAnchorGravity::kBottomRight, anchor->anchor_gravity);
EXPECT_EQ((ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideX |
ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideY |
ui::OwnedWindowConstraintAdjustment::kAdjustmentFlipY |
ui::OwnedWindowConstraintAdjustment::kAdjustmentRezizeY),
anchor->constraint_adjustment);
Expand Down

0 comments on commit a086ad0

Please sign in to comment.