Skip to content

Commit c53e937

Browse files
committed
WindowServer: Constrain popup menu Y position within screen rect
This fixes an issue where large popup menus would open upwards despite there not being enough space for that.
1 parent 4c6e3d0 commit c53e937

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Userland/Services/WindowServer/Menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
590590
adjusted_pos = adjusted_pos.translated(-window.width(), 0);
591591
}
592592
if (adjusted_pos.y() + window.height() >= Screen::the().height() - margin) {
593-
adjusted_pos = adjusted_pos.translated(0, -window.height());
593+
adjusted_pos = adjusted_pos.translated(0, -min(window.height(), adjusted_pos.y()));
594594
if (as_submenu)
595595
adjusted_pos = adjusted_pos.translated(0, item_height());
596596
}

0 commit comments

Comments
 (0)