Commit cdb0f5bb authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Allow compositor server to resize the menu when necessary

This allow the menu to resize, which in turn will enable scrolling
so that a user can use all menu options.

I'll work on a wrap around behavior in a separate CL.

Bug: 1099880
Change-Id: If2f92894fb25684f12dd0f232758f9b968c8e0ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542854
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#828558}
parent 450baeab
......@@ -1408,26 +1408,29 @@ TEST_P(WaylandWindowTest, AdjustPopupBounds) {
ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | ZXDG_POSITIONER_V6_ANCHOR_RIGHT,
ZXDG_POSITIONER_V6_GRAVITY_BOTTOM | ZXDG_POSITIONER_V6_GRAVITY_RIGHT,
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X |
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y};
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y |
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y};
nested_menu_window_positioner = {
gfx::Rect(4, 80, 279, 1), gfx::Size(305, 99),
ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_RIGHT,
ZXDG_POSITIONER_V6_GRAVITY_BOTTOM | ZXDG_POSITIONER_V6_GRAVITY_RIGHT,
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X |
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y};
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y |
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y};
} else {
menu_window_positioner = {gfx::Rect(439, 46, 1, 30), gfx::Size(287, 409),
XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT,
XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT,
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X |
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y};
menu_window_positioner = {
gfx::Rect(439, 46, 1, 30), gfx::Size(287, 409),
XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT,
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X |
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y |
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y};
nested_menu_window_positioner = {
gfx::Rect(4, 80, 279, 1), gfx::Size(305, 99),
XDG_POSITIONER_ANCHOR_TOP_RIGHT, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT,
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X |
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y};
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y |
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y};
}
auto* toplevel_window = window_.get();
......
......@@ -236,17 +236,19 @@ uint32_t GetConstraintAdjustment(MenuType menu_type, bool stable) {
switch (menu_type) {
case MenuType::TYPE_RIGHT_CLICK:
constraint = WlConstraintAdjustment::SlideX |
WlConstraintAdjustment::SlideY |
WlConstraintAdjustment::FlipY;
constraint =
WlConstraintAdjustment::SlideX | WlConstraintAdjustment::SlideY |
WlConstraintAdjustment::FlipY | WlConstraintAdjustment::ResizeY;
break;
case MenuType::TYPE_3DOT_PARENT_MENU:
constraint =
WlConstraintAdjustment::SlideX | WlConstraintAdjustment::FlipY;
constraint = WlConstraintAdjustment::SlideX |
WlConstraintAdjustment::FlipY |
WlConstraintAdjustment::ResizeY;
break;
case MenuType::TYPE_3DOT_CHILD_MENU:
constraint =
WlConstraintAdjustment::SlideY | WlConstraintAdjustment::FlipX;
constraint = WlConstraintAdjustment::SlideY |
WlConstraintAdjustment::FlipX |
WlConstraintAdjustment::ResizeY;
break;
case MenuType::TYPE_UNKNOWN:
NOTREACHED() << "Unsupported menu type";
......
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