From 6bd4f3f9d78be69cb6fce3e9d7f757789f246a39 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 13 Dec 2025 16:57:28 +0100 Subject: =?UTF-8?q?Windows:=20Fix=20"If=20app=20appears=20on=20non-active?= =?UTF-8?q?=20screen=20=E2=80=A6,=20window=20resizes"=20(#259)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix puts the first window an app creates on the screen containing the mouse, because the present window creation code needs to know on what screen a created window is going to appear before creating it. --- src/Fl_win32.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index d31568778..da0e20895 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -2190,9 +2190,11 @@ void Fl_WinAPI_Window_Driver::makeWindow() { Fl_Window *hint = Fl::first_window(); if (hint) { nscreen = Fl_Window_Driver::driver(hint->top_window())->screen_num(); - } else { + } else if (Fl::screen_driver()->screen_count() > 1 ) { int mx, my; nscreen = Fl::screen_driver()->get_mouse(mx, my); + float s = Fl::screen_driver()->scale(nscreen); + w->position(mx/s, my/s); // put the new window on same screen as mouse } } Fl_Window_Driver::driver(w)->screen_num(nscreen); -- cgit v1.2.3