From f2fb8eb6bf2f161f0dba934ab6908649558562b2 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:24:45 +0100 Subject: [PATCH] Improve Fl_Window::hotspot() when diverse screens have diverse scale factors. --- src/Fl_Window_hotspot.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Fl_Window_hotspot.cxx b/src/Fl_Window_hotspot.cxx index 82a019979..3b65f7e71 100644 --- a/src/Fl_Window_hotspot.cxx +++ b/src/Fl_Window_hotspot.cxx @@ -17,12 +17,15 @@ #include #include #include "Fl_Window_Driver.H" +#include "Fl_Screen_Driver.H" void Fl_Window::hotspot(int X, int Y, int offscreen) { int mx,my; // Update the screen position based on the mouse position. - Fl::get_mouse(mx,my); + int ms = Fl::screen_driver()->get_mouse(mx,my); + // put the window on the mouse-containing screen + this->screen_num(ms); X = mx-X; Y = my-Y; // If offscreen is 0 (the default), make sure that the window