From 03cad76031d01b414909bb9241d719e16d7fa6de Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 16 Mar 2026 15:57:00 +0100 Subject: [PATCH] Fix "Menu windows appear at wrong positions and sizes with multiple displays" (#1380) --- src/Fl_Menu.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index b7302ee75..b020d6845 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -348,7 +348,7 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp, menubartitle = menubar_title; origin = NULL; offset_y = 0; - int n = (Wp > 0 ? Fl::screen_num(X, Y) : -1); + int n = Fl_Window_Driver::menu_parent()->screen_num(); Fl_Window_Driver::driver(this)->menu_window_area(scr_x, scr_y, scr_w, scr_h, n); if (!right_edge || right_edge > scr_x+scr_w) right_edge = scr_x+scr_w; @@ -1104,7 +1104,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( int dy = n->y()-nY; int dx = n->x()-nX; int waX, waY, waW, waH; - Fl_Window_Driver::driver(n)->menu_window_area(waX, waY, waW, waH, Fl::screen_num(X, Y)); + int ns = Fl_Window_Driver::menu_parent()->screen_num(); + Fl_Window_Driver::driver(n)->menu_window_area(waX, waY, waW, waH, ns); for (int menu = 0; menu <= pp.menu_number; menu++) { menuwindow* tt = pp.p[menu]; int nx = tt->x()+dx; if (nx < waX) {nx = waX; dx = -tt->x() + waX;}