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
Notes:
sideshowbarker
2024-07-18 18:26:40 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c53e9370144
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