1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

WindowServer: Fix menu location on screens other than main screen

The menus always thought they were being outside of the main screen,
which caused them to be left and/or top aligned. This also fixes the
calculation of the available space by using the screen rectangle where
it will be displayed.
This commit is contained in:
Tom 2021-06-27 14:40:51 -06:00 committed by Andreas Kling
parent 2d4eb40f59
commit 30f531a55f
4 changed files with 34 additions and 26 deletions

View file

@ -845,7 +845,7 @@ void WindowFrame::open_menubar_menu(Menu& menu)
{
auto menubar_rect = this->menubar_rect();
MenuManager::the().close_everyone();
menu.ensure_menu_window().move_to(menu.rect_in_window_menubar().bottom_left().translated(rect().location()).translated(menubar_rect.location()));
menu.ensure_menu_window(menu.rect_in_window_menubar().bottom_left().translated(rect().location()).translated(menubar_rect.location()));
MenuManager::the().open_menu(menu);
WindowManager::the().set_window_with_active_menu(&m_window);
invalidate(menubar_rect);