summaryrefslogtreecommitdiff
path: root/src/Fl_Window_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-03-10 10:14:58 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-03-10 10:14:58 +0100
commitf4f93fda159abf83937eece89ac574eff772a507 (patch)
treef984adda3fec1c6fd5e6804f8100f95ff0dc4989 /src/Fl_Window_Driver.cxx
parentb09d09e3c5bed3f19feda37d2d1f06c4f4634f84 (diff)
Fix handling of menu widnows taller than their screen
A problem was visible with the menubar test app and a 2-screen system where screens are one above the other. When moving down the huge menu, it became positioned on the wrong screen.
Diffstat (limited to 'src/Fl_Window_Driver.cxx')
-rw-r--r--src/Fl_Window_Driver.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx
index f0fc76a89..ccf5f1a07 100644
--- a/src/Fl_Window_Driver.cxx
+++ b/src/Fl_Window_Driver.cxx
@@ -239,7 +239,13 @@ void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_
}
void Fl_Window_Driver::reposition_menu_window(int x, int y) {
- if (y != pWindow->y() || x != pWindow->x()) pWindow->Fl_Widget::position(x, y);
+ if (y != pWindow->y() || x != pWindow->x()) {
+ int ns = pWindow->screen_num();
+ pWindow->Fl_Widget::position(x, y);
+ Fl::check();
+ // the window move may erroneously change the window's screen number; reset it
+ if (pWindow->screen_num() != ns) screen_num(ns);
+ }
}
void Fl_Window_Driver::menu_window_area(int &X, int &Y, int &W, int &H, int nscreen) {