From 818a2ab838bd5d73cdd7f1394e8f153f63c62097 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 10 Feb 2021 10:18:55 +0100 Subject: Windows scaling support: fix after WM_MOVE and in mouse_event() The fix in mouse_event() makes sure the scale factor of the receiving window is correct when distinct screens have distinct scale factor values. The fix after WM_MOVE event makes sure a subwindow-containing window in a multiple-screen desktop having distinct scale factor values is correctly rescaled. --- src/Fl_win32.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index bd37dddd1..440e974e9 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1010,7 +1010,7 @@ static int mouse_event(Fl_Window *window, int what, int button, WPARAM wParam, LPARAM lParam) { static int px, py, pmx, pmy; POINT pt; - float scale = Fl_Graphics_Driver::default_driver().scale(); + float scale = Fl::screen_driver()->scale(window->screen_num()); Fl::e_x = pt.x = (signed short)LOWORD(lParam); Fl::e_y = pt.y = (signed short)HIWORD(lParam); Fl::e_x /= scale; @@ -1597,7 +1597,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar // sd->scale(olds),news, s, // Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy); // fflush(LOG); - if (olds != news) { + if (olds != news && !window->parent()) { if (s != sd->scale(olds) && !Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy && window->user_data() != &Fl_WinAPI_Screen_Driver::transient_scale_display) { -- cgit v1.2.3