mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
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.
This commit is contained in:
parent
4c6e3d0c59
commit
c53e937014
1 changed files with 1 additions and 1 deletions
|
@ -590,7 +590,7 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
|
|||
adjusted_pos = adjusted_pos.translated(-window.width(), 0);
|
||||
}
|
||||
if (adjusted_pos.y() + window.height() >= Screen::the().height() - margin) {
|
||||
adjusted_pos = adjusted_pos.translated(0, -window.height());
|
||||
adjusted_pos = adjusted_pos.translated(0, -min(window.height(), adjusted_pos.y()));
|
||||
if (as_submenu)
|
||||
adjusted_pos = adjusted_pos.translated(0, item_height());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue