Fix "Wrong tooltip position on Wayland with secondary monitor" (#894)

This commit is contained in:
ManoloFLTK 2024-01-23 10:40:25 +01:00
parent 5cc5a60e09
commit da8d6c8d77

View File

@ -96,6 +96,7 @@ void Fl_TooltipBox::layout() {
for (Fl_Widget* p = Fl_Tooltip::current(); p; p = p->window()) {
oy += p->y();
}
if (!Fl_Window_Driver::driver(this)->popup_window()) {
int scr_x, scr_y, scr_w, scr_h;
Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
if (ox+ww > scr_x+scr_w) ox = scr_x+scr_w - ww;
@ -107,6 +108,7 @@ void Fl_TooltipBox::layout() {
if (oy+hh > scr_y+scr_h) oy -= (4+hh+currentTooltipH);
}
if (oy < scr_y) oy = scr_y;
}
resize(ox, oy, ww, hh);
}