Ver Fonte

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.
Andreas Kling há 4 anos atrás
pai
commit
c53e937014
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      Userland/Services/WindowServer/Menu.cpp

+ 1 - 1
Userland/Services/WindowServer/Menu.cpp

@@ -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());
     }