diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-10 10:18:55 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-10 10:19:08 +0100 |
| commit | 818a2ab838bd5d73cdd7f1394e8f153f63c62097 (patch) | |
| tree | e3f96102407badff650c79cc1063a4ac0c116d56 | |
| parent | b4c464f71bab394c366a3c6fe109893661e0c03b (diff) | |
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.
| -rw-r--r-- | src/Fl_win32.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |
