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.
This commit is contained in:
parent
b09d09e3c5
commit
f4f93fda15
@ -492,7 +492,7 @@ void menuwindow::autoscroll(int n) {
|
||||
int Y = y()+Fl::box_dx(box())+2+n*itemheight;
|
||||
|
||||
int xx, ww;
|
||||
Fl_Window_Driver::driver(this)->menu_window_area(xx, scr_y, ww, scr_h);
|
||||
Fl_Window_Driver::driver(this)->menu_window_area(xx, scr_y, ww, scr_h, this->screen_num());
|
||||
if (n==0 && Y <= scr_y + itemheight) {
|
||||
Y = scr_y - Y + 10;
|
||||
} else if (Y <= scr_y + itemheight) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user